tag:blogger.com,1999:blog-609053800960952665.post8250058357818889671..comments2024-02-17T10:52:20.414+02:00Comments on A Programmer's Blog Spot: "If" conditional does not work properlyAlon Diamanthttp://www.blogger.com/profile/00808061872123707089noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-609053800960952665.post-26729324759024231922023-08-13T00:06:07.855+03:002023-08-13T00:06:07.855+03:00kuşadası
trabzon
zonguldak
balıkesir
hatay
Q3636...<a href="https://www.escorthun.com/" title="kuşadası" rel="nofollow">kuşadası</a><br /><a href="https://fethiyebayan.escorthun.com/" title="trabzon" rel="nofollow">trabzon</a><br /><a href="https://zonguldak.escorthun.com/" title="zonguldak" rel="nofollow">zonguldak</a><br /><a href="https://balikesir.escorthun.com/" title="balıkesir" rel="nofollow">balıkesir</a><br /><a href="https://hatay.escorthun.com/" title="hatay" rel="nofollow">hatay</a> <br /><br />Q3636egenoreply@blogger.comtag:blogger.com,1999:blog-609053800960952665.post-61222490567979331482009-05-26T22:40:42.777+03:002009-05-26T22:40:42.777+03:00(that was from advance, sorry)(that was from advance, sorry)Anonymoushttps://www.blogger.com/profile/09253626607878245063noreply@blogger.comtag:blogger.com,1999:blog-609053800960952665.post-37239302543684379372009-05-26T22:39:15.837+03:002009-05-26T22:39:15.837+03:001. How can a coding style be gay? :) If you think ...1. How can a coding style be gay? :) If you think about it - the only way I could've discovered this error is with the "== true" syntax. with a "if (x)" syntax, I would never realize that there is a problem with the return value. What if it was meant to be false? It is only luck that the return value was meant to signify success. <br /><br />2. I personally believe in checking the return value, always. This prevents cases in which you assume that a return value is "true"-thful, when really only 0 is "success" and non-zero are error codes. This happens a lot with int return values. All in all, I am very much for the intrinsic bool type, and I do believe that checking for == true is the way to go.<br /><br />3. This is correct, but so what?Anonymoushttps://www.blogger.com/profile/09253626607878245063noreply@blogger.comtag:blogger.com,1999:blog-609053800960952665.post-20897446738975518072009-05-26T16:19:24.134+03:002009-05-26T16:19:24.134+03:001. == true is gay. Your if's should be self explan...1. == true is gay. Your if's should be self explanatory. and always != FALSE, never == true.<br />2. It only works if your function returns a bool (it won't work if your function returns an int a BOOL or any other typedef).<br />3. !!x will make it 0 if x is 0, 1 if x isn't zero.Anonymousnoreply@blogger.com