Skip to main content

Blog Archive for staufferjames during June 2007

The code below actually prints "yikes!" If you return in a finally block then any Throwables that aren't caught (in a catch block that is part of the same try statement as the finally block) will be completely lost. The really bad part about this is that it looks so innocent. I can think of no reason to return in a finally clause. If nothing else, catch(Throwable t) and return in that so it is...
A pet peeve of mine is when a variable is declared way before it is needed. It is much easier to understand a piece of code if a variable is declared just before it is needed. That immediately tells me that it isn't used anywhere before that or in any wider scope. I also find it annoying when a variable is declared with a null value and them immediately assigned a value. String value = null;...
When the user drags an item to a location, slows movement, and then makes a quick movement right before finishing the drag, the user probably wanted the ending location to be the mouse location right before the quick movement. The user should be prompted for which target they want if the quick movement changed the target. With normal mice there probably isn't often a quick movement but I use a...
How do you make money with open-source software? You don't, you save money! (Some companies do make money but many more companies could save money). More companies are concerned with using software than selling software. If users of software fund the open-source development of software then it will make economic sense for the software to be developed open-source. If 50% of companies that buy...