Check Your Style

I decided that it is about time to stop coding like a monkey and start doing things right from the start (and I should also quit smoking… o well, lets take life one step at a time). So I installed a couple of eclipse plug-ins to help me in this, guided by the “Automation for the people: Improving code with Eclipse plugins” article kindly provided by IBM.
After installing Checkstyle, I realized that my code has NO style… so for the next couple of hours/days I’m going to fix the code (writing javadocs is definitely fixing your code) that was written in the last month. Just look at is an investment for the future.
One thing that Checkstyle complained a lot about is the final keyword, everywhere in the code, from classes to methods and parameters. Since I’m not a big user of the final keyword, this was a good moment to investigate why it is regarded such good style to add it everywhere to your code. Google provided some enlightening articles like this, this and this. There are contradictory views on the subject but it seems that the Checkstyle guys are definitely in favor of using it the final keyword liberally. Me? it seems useful but overusing it can cause the code to look ugly, so as usual the search for the golden path continues.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.