4 ms·
Personally, I find it easier to parse if the conditional is not only exhaustive, but itself returns a value (functional languages like Ocaml, Scala, Elixir have
by rory 6y ago
Personally, I find it easier to parse if the conditional is not only exhaustive, but itself returns a value (functional languages like Ocaml, Scala, Elixir have this).
Judging by the number of long, goofy-looking nested ternary expressions I find in Javascript code, a lot of people feel this way.
- oaiey 6y agoIn functional programming everything is essentially an expression. So coming from there to procedural programming will create patterns like that or ternary expressions. I come from a pascal/assembler school of thinking which is favoured in the OO/procedural languages. So when a language is using a procedural sytax then I code also in that style.