Re:Porting 4.5K lines of C to Go
by seanwilson on Saturday August 05, 2017 @08:24AM
(#14935379)
The ternary operator can be nice for conciseness and to ensure a variable has been assigned to when the language doesn't check that for you e.g.
vs
I miss being able to write code like this in languages like OCaml:
[ Parent
| on HN ]
Heh your OCaml example is why I adore Nim, and any other languages that "expression all the things!" -- even modern JavaScript is decent on this front with 'ramda' and my favourite helper library @unction: https://github.com/krainboltgreene/unction.js/blob/core/READ...
Between those two, consise readable functional JS code based entirely around expressions is simple to achieve. It's genuinely made me happy to be back in JS land