Skip to content

Comment on ES6 in Depth: Destructuringparent

Comments

I agree with that. All these features are amazing, but the fact that these modification must be only additive make their implementation feel clunky.

Javascript was born with enormous defects that it's too late to remove, and adding new features, regardless of their undoubtable usefulness, make the whole language more difficult to handle. The number of concepts required to read ES6 is far more than the one required for ES5, and this number is just destined to get higher and higher, with no possibility to decrease.

I hear this type of argument a lot... regarding "Javascript was born with enormous defects..." would you mind citing some defects that aren't possible to simply ignore in practice?

I know that Automatic Semicolon Insertion, Hoisting, Scopes and mostly automatic type casting are brought up a lot...

Regarding ASE (use a linter, and always require them)

For Hoisting it's a matter of learning the language and isn't any different than many other languages in that regard.

As to functional closures/scoping... the new "let" allows you to move away from that in practice

For automatic type inferrence/casting... I think this is absolutely one of the more powerful features of JS, and allows for validating end-user input to be far more easy/flexible than most other systems that would presume to convert user input to a date, or a number, etc. This is my own opinion, but I've seen few better systems and JS doesn't require you to load up a bunch of try/catch blocks to do it.

I bring these up, because I don't think they are defects in the language, except maybe the only closures being at the function level, and related to this being able to use undeclared variables, both of which are addressed in practice by newer features.

Old features can be abandoned and forgotten. For instance, I don't even know what "with" does anymore. We don't want a python 3 situation on our hands.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.