K&R are right

My new hobby at work is slamming my keyboard on my head while changing the code that the previous coop worked on. You’ve heard me whine about coding style before, but holy crap, who the hell codes like this?

public static String function ()throws IOException, SAXException{ and so on.

Who the hell puts a space in between their function name and argument list? Who the hell doesn’t put a space in between their argument list and exception throwing stuff? Who bloody puts the opening brace of a function on the same lines as the function declaration?

You know what’s even better?

if (variable.equals(something.else)) {
        bla bla bla;
}
else if (variable.equals(something.again)) {
        ...

Did you catch that? Because it took me a few looks at it to really see what was going on there. Now you might have seen it immediately, but try looking at it when there are fifteen other branches. It’s even better when another if statement begins after this one ends with no whitespace in between them.

I swear if I ever get put in charge of a team of developers, the first thing I will do is beat them over the head with a copy of The C Programming Language until they respond with “K&R are right” whenever I mention braces.

Don’t make me get the book.

Tags:

Leave a Reply