by brundolf · 4y ago · 0 comments
1) Advanced features that cannot be replicated without runtime support
2) Syntax sugar
Symbols, BigInt, and generators are the former. Pipes and classes are the latter. (1) gives library authors access to low-level primitives that can allow them to do things that were literally impossible before (I've gotten a lot of use out of Symbols, personally), but they aren't often used directly in application code. (2) are usually more application-facing, and may or may not be a big enough quality of life improvement to justify their existence.
I guess what I'm saying is: just because you haven't seen lots of Symbols or generators in the wild doesn't mean they aren't having an impact, or weren't worth adding.
It’s probably getting to the point where it’s no longer necessary in a lot of cases, but these constructs that “nobody uses” were able to implement the newer and more widely features long before they were available in browsers.
> they aren't often used directly in application code
The problem for me with this is that abstractions leak, and suddenly you are wondering why you cannot add two simple numbers or why there's a 3rd level of hidden properties in objects.
(1) Adds more possibilities, performance improvements, operational shortcuts.
(2) Adds redundant way to do one thing. IOften confuse more than help in the long run.
The former also should not be excluded from application code. Application coder should also be familiar with what those are for.