Re:Signs You're a Crappy Programmer (and don't know it)
by Tichy on Sunday November 25, 2007 @05:38PM
(#83406)
I've seen whole projects fail over that discussion.
Maybe it really should be used as an interview question. There is no point in mixing same-liners and new-liners together.
Only remedy might be to use a programming language without curly braces.
Re:Signs You're a Crappy Programmer (and don't know it)
by DanielBMarkham on Sunday November 25, 2007 @06:33PM
(#83415)
I have to admit it's a pet peeve for me -- even more than choice of languages, oddly enough. When scanning code, I just like the ability to see my control blocks clearly. Simply because you can do something like this
if (a==b) { doStuff(); } else doOtherStuff();
Doesn't mean you should.I would consider this a little bit of a hangup on my part, though, as it seems other programmers go the other way. An interesting topic for a book is all the weird things programmers get hung up about. Variable naming comes to mind, as does error handling strategies. And when we get hung up, usually we're not too shy about explaining why everybody else is wrong!
Re:Signs You're a Crappy Programmer (and don't know it)
by Tichy on Monday November 26, 2007 @02:50AM
(#83517)
I would not put everything on the same line, but I admit to putting the opening bracket on the same line. In fact, I consider the other variant extremely ugly. Just consider
if(...)
{
...
}
else
{
...
}
vs if(...) {
...
} else {
...
}
I can't for the life of me understand why someone would want to move the bracket to the new line ;-) It's just empty (wasted) space without any meaning. I can see the control blocks with the tighter version just fine, plus, it's the Sun Coding Convention for Java. But it's really a fruitless discussion...
I mean, we can debate silly stuff all day, like LISP versus C, Firefox vs. IE, Mac vs. PC, web 1.0 vs web 2.0, etc. But these "braces on the same line" guys are just completely out of their minds. :) <-- Smiley face means humor was used in this comment.