Some days, Java is all syntax and no semantics. Today I coded seven levels of indentation in twenty-five lines:
public void onLogUpdated() {
beginUse();
try {
synchronized (this) {
final SubscriberMessage next = log.getCurrent();
if (next == last) {
return;
}
last = next;
new SafeRunnable() {
protected void runProtected() throws Exception {
if (doesTone) {
soundTone(next);
}
if (doesAnnounce) {
soundAnnounce(next);
}
}
}.start();
}
} finally {
endUse();
}
}
A few lines of actual functionality and the rest is big heavy structure and great gobs of static typing. Normally when I end up with a scrappy method like this, I can see a simple way to make more understandable - but not today. Anyone have a suggestion for making this method nicer to look at?
Perhaps a cold beverage will help.
Inside every nerd is a comedian, struggling to get out. We brought a client’s old CVS repository back to the office. I put it onto a server and emailed the CVSROOT details to a colleague. He wrote back:
Thanks. I’ll check it out.
“Check it out”! Get it? Check out ? On a repository! Ha ha ha ha ha ha.