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

I agree with jblow. I consider ternary a "sharp knife" in that even though it saves space, I never want to see it used more than one level deep. I don't want sharp knives in my code, I want Lego bricks. If that means the source code is a little bigger or the runtime is a little slower, that's OK, the vast majority of the time.

The most egregious example of I can think of in this kind of thing is JS "gurus" who try to use the fewest semicolons possible in their unminified source. It doesn't add readability, and the semicolon rules are complicated enough that one could easily write a bug while trying to stick to the style.

Sometimes languages have "tricks" that aren't sharp, and those are OK to use when you know them, but one has to distinguish.



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

Search: