3 ms·
To be fair, going from a less syntactically rich syntax to an almost complete superset of it isn't too hard. Yet, to draw from that the conclusion that javascri
by IvoDankolov 15y ago
To be fair, going from a less syntactically rich syntax to an almost complete superset of it isn't too hard. Yet, to draw from that the conclusion that javascript, or any other modern language of that family is pretty much the same seems like too much of a stretch to me. I just don't buy the argument that "oh, pretty much no one uses the new syntax" invalidates it.
One usually doesn't go around designing features around what an idiot would use. And to ignore a feature on that exact point, I think, completely misses how much modern compilers can do for you. I'd very much like to see converting something that uses yield[0] to generate collections in C#, or handling variable capture and anonymous functions to, say, C, by just twiddling around with the syntax.
[0] : I have working lazy evaluated collections in C++, complete with state machine generating code. It is not, by any stretch of the imagination, pretty to implement. However, being able to say - naturals()->Map([](int x) { return 2 * x; })->Take(N); - can be pretty satisfying.