Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I hate to be that person, but your extra two characters version is only slightly less prone to errors than the one that you are replacing. At the very least, if you are going to insist that these be required, the closing has to be on its own line, or you lose much of the benefit.

And, while I do agree it is easy to vilify this style of statement, I question hating on it. I have found reading code like this is somewhat easy to read if you have internalized reading it to be "if this, then do a single thing." Where the "a single thing" is different from the normal reading of "if this, then that."

Still, I support style guides that prohibit this.



Much to easy to read over, much less likely to get syntax errors on a merge tool mistake, internalise all you like to make fewer mistakes and still don't do it and there will be fewer mistakes. Even if you're so amazing you could never make that mistake yourself a future maintainer might, a tool might and your benefit for taking that risk is zero.

I hate it because it's just so silly. Do we use a feature that has no benefit and carries risk? Do we really need a statistical analysis for this one?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: