5 ms·
One of the things I dislike most about JavaScript is the syntax. I always thought the Javaesque syntax hid the some of the nice semantics underneath. CoffeeScri
by erokar 9y ago
One of the things I dislike most about JavaScript is the syntax. I always thought the Javaesque syntax hid the some of the nice semantics underneath. CoffeeScript and LiveScript help reveal that language.
I really hope Reason doesn't make the same mistake and go for a more ALGOL-like syntax. My hope would be that they go for an even cleaner syntax than the current, more like Standard ML and Elm. The semicolons and the curly braces will not be missed.
- klibertp 9y agoIt's not ALGOL-like syntax that's a problem with JS, it's the fact that for decades the JS syntax was frozen, without any significant additions to the initial, very minimal, syntax. The same is true for JS standard library: it's almost non-existent compared to Python or Ruby, and even Lua has more builtins (IIRC). In other words, you can have good looking FP support with braces and semicolons. It's just that you need to build such support into the language, and for JS it was impossible for a long time.
- erokar 9y agoI'm not complaining that JS isn't Haskell. Underneath the C/Java syntax JS is a small, simle, Lispy, dynamic language — if you like that kind of thing. JS' syntax hide that. CoffeeScript helped reveal it. > In other words, you can have good looking FP support with braces and semicolons. Of course. But why would you?
- jasim 9y agoI love braces and semicolons and my biggest gripe with CoffeeScript and HAML and Python was that they used space to delimit blocks. The good thing about braces is that moving code around is easy and it makes auto-formatting possible. refmt, prettier etc. are all amazing to have. But in terms of syntactic preferences, it is quite subjective and I wouldn't claim there is one true answer.
- christophilus 9y agoI agree. I wish the Reason team would just use BuckleScript and pure OCaml syntax. I really don't like the addition of syntactic noise that Reason has introduced.
- jordwalke 9y agoYou already have that option. Reason's syntax is for the vast majority of developers that do not prefer OCaml's syntax, the majority of them not being OCaml programmers.