4 ms·
Do you know if there's any evidence that ternaries beat ifs for people understanding code in practice or in people's self-assessments? Would not have been my gu
by caturopath 6y ago
Do you know if there's any evidence that ternaries beat ifs for people understanding code in practice or in people's self-assessments? Would not have been my guess at all.
- ZephyrBlu 6y agoAn anecdotal data point: I prefer ternaries unless the if statement is for control flow. They're terser and don't stick out as much in the code.
- memco 6y agoIf Hillel Wayne’s talk on empirical software design is any good measure then either method is fine[0] so long as you and the team you work with can agree about it’s utility in code review. If it’s just you on the project then do whatever is most comfortable. [0] https://m.youtube.com/watch?v=WELBnE33dpY https://m.youtube.com/watch?v=WELBnE33dpY