Hacker News new | past | comments | ask | show | jobs | submit login

Nice, clean approach. I wish ternary operations were more common and widely understood; some people might freak out when they see that, specially with the unusual indentation. I had to condition myself to go back to if/else to avoid the blame.



If as an expression is very nice indeed, especially in Lisp (where it comes from).

If you use CoffeeScript however, you also get expression if. Very handy.


If someone doesn't understand ternary operations they need to take off the developer badge. Given they're a common feature in most languages and make life easier it's a pretty big thing to have glossed over.


You'd be surprised.




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

Search: