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

It's all about familiarity. To me ternaries gives me less ways in which the code can behave, so it takes less time to write, and less time to read. The obvious reason is that it's an expression and not a statement. So, the reason for me not writing it like this to begin with, is because I prefer ternaries over ifs. So much that i sometimes rewrite other code from ifs to ternaries to better grasp it. But that's me.



Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: