Interesting question

A recent article on java.net had this interesting question “Why Do Pointless if Statements Even Compile?“.  I went through the article as well as the comments made by readers.  It is a good one, made me think and the question seems to be really valid and not at all a stupid question.  I think it would be all the more costly to do a check in the compiler rather than just allow it as it is syntactically right.  The only time this would produce a side effect is when the if condition does not have an else. Otherwise putting an else would throw a compilation error “else without if”. Following a coding standard and using code check utilities like checkstyle can also help. Nevertheless it is an interesting question.

Blink this Interesting question at blinklist.com    Bookmark Interesting question at blogmarks    Bookmark Interesting question at del.icio.us    Digg Interesting question at Digg.com    Fark Interesting question at Fark.com    Bookmark Interesting question at Furl.net    Bookmark Interesting question at NewsVine    Bookmark Interesting question at reddit.com    Bookmark Interesting question at Simpy.com    Bookmark Interesting question at Spurl.net    Bookmark Interesting question with wists    Bookmark Interesting question at YahooMyWeb

      Cosmos

Leave a Comment

authimage


Creative Commons License  This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.