Method Exception Signature

In short, all interface methods, if they throw anything, should be declared to throw ‘java.lang.Exception’ and never a specialized exception class.  Find this surprising? then please read on.  The original goal to allow methods to declare the type of exceptions they might throw was a valiant attempt to clarify program behavior, but unfortunately it was misguided, does not work, and if used incorrectly can turn into a maintenance nightmare. Continue reading


Don’t Suffer Poor Names

You know the problem: you write a method for one purpose and give it a name.  Later, it become useful for something else, or maybe you change it slightly to accommodate another use, or maybe some names change elsewhere making the current name obsolete.  You have all seen code where someone says that the name “is historical” or traditional.  This post is to say with conviction that that history is NOT interesting, and get rid of it.  Get a good IDE and change those names to be correct. Continue reading

#9 Avoid “Big Bang” Changes

There always comes times when program needs to be changed, and some existing classes need to change roles.This post talks about strategies to avoid making a big change all at once.  The problem with a big change, is that when doing the change in isolation of other developers, you run a significant risk of clash and ultimately bugs.  Here are some techniques to make all changes, no matter the size, implemented incrementally. Continue reading