tag:blogger.com,1999:blog-8838158931136582952.post5872611650394141395..comments2023-04-07T13:25:47.502+02:00Comments on java.net.Blog: Else is evilTomáš Kramárhttp://www.blogger.com/profile/12420015656795241246noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-8838158931136582952.post-74818042834818168932009-04-27T02:00:00.000+02:002009-04-27T02:00:00.000+02:00Great topic. I never understood the abuse of if/el...Great topic. I never understood the abuse of if/else and I use it very seldom. Without knowing that blog I wrote an article having similar title If Else is evil(http://litun.blogspot.com/)<br />After I published it I started looking on the Web for something similar and I found this one.<br />I have found many bugs over the years that came from using if else not in the right place.Ivan Assenovhttp://litun.blogspot.com/noreply@blogger.comtag:blogger.com,1999:blog-8838158931136582952.post-23152468726647399622008-01-17T17:52:00.000+01:002008-01-17T17:52:00.000+01:00Quote: Using else here is appropriate too, as it r...Quote:<I> Using else here is appropriate too, as it represents exactly one condition. A boolean can never be anything else than true, or false. True or false, two conditions, two branches and there is no way for third.</I><BR/><BR/>it's rather amusing reading this as you might want to know that <B>if</B> statement always evaluates to... boolean :) true or false. if not NullReferenceException of course...COTOHAhttps://www.blogger.com/profile/12963744623193079135noreply@blogger.comtag:blogger.com,1999:blog-8838158931136582952.post-78051531708775628222008-01-10T14:26:00.000+01:002008-01-10T14:26:00.000+01:00It was not an example of good domain model, I agre...It was not an example of good domain model, I agree, nor was in intended to be. It was an example of if-else chain.Tomáš Kramárhttps://www.blogger.com/profile/12420015656795241246noreply@blogger.comtag:blogger.com,1999:blog-8838158931136582952.post-55731650151577110242008-01-10T13:37:00.000+01:002008-01-10T13:37:00.000+01:00And what is it with the == trueAnd what is it with the == truePaulo Fariahttps://www.blogger.com/profile/02374231047153225371noreply@blogger.comtag:blogger.com,1999:blog-8838158931136582952.post-85122896699739518252008-01-10T13:36:00.000+01:002008-01-10T13:36:00.000+01:00Or you could enter the 21º century and use polymor...Or you could enter the 21º century and use polymorphism in your getDelivery() result, you know grouping data and behavior in classes?Paulo Fariahttps://www.blogger.com/profile/02374231047153225371noreply@blogger.com