by ebbv · 13y ago · 0 comments
If someone who worked with me wrote that I'd talk to them about it and make sure they never did anything like that ever again.
From the terrible argument names to the abuse of the single line if syntax (which should never be used anyway, always use curly braces.)
It is like football, it does not matter how brilliant a team plays, but which one has higher score when the referee signals the end of the game.
Yes, of course, I know the argument: a one-line bracketless "if" can set-up a future developer for failure if they need to add an item to the conditional block. And if they for some reason decide not to read the actual conditional. And if they don't test it.
And I don't hate code that uses braces even when they're not strictly needed, but I personally prefer to omit them. And my feeling is that the dogma around braceless-ifs is a little overblown.
Of course when working on a team that has adopted a no-braceless-if policy, I conform. Having consistent code is way, way more important than somebodies own favorite bracing style.
But you're taking it to a level for snark that really isn't warranted. I can think of at least 4 ways to iterate a list. It's about doing something the easiest/best way for the circumstance.
How about this one? http://git.savannah.gnu.org/gitweb/?p=coreutils.git;a=blob;f...
There's worse songs than "Who Let the Dogs Out" but it's still a really bad song.
https://feralbynight.googlecode.com/files/FeralbyNightv3_2_b...