Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Comparing the Same Project in Rust, Haskell, C++, Python, Scala and OCaml. Parent comment
I also tend to format them thus:
int a = b == 1 ? 2 : b == 2 ? 3 : b == 3 ? 5 : -1;
Still, a language having proper support for expressive conditionals is probably better.
Also the way Python's ternary was defined means it should never ever be nested, it looks nasty.
There are no comments on this comment yet.
I also tend to format them thus:
Feels much more "case analysis-y" and clearer.Still, a language having proper support for expressive conditionals is probably better.
Also the way Python's ternary was defined means it should never ever be nested, it looks nasty.