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

> In my mind, an if/else block is an imperative entity that describes two different actions that could happen. Even if in reality both branches are trivial, my mind will be unnecessarily occupied with the fact that it needs to reason about code here, not just data

That's true in some languages. But in some languages if-else can also be used as in expression. e.g. in Rust I can write:

    let foo = if condition { "FOO" } else { "BAR" }



... which is equivalent to a ternary, hence the thesis.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: