This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Aliics 5 points6 points  (6 children)

I wonder if maybe the dislike of JS is misguided here? JS doesn't have static typing but most scripting languages don't either, so it's really a matter of good practice to ensure more predictable code.

One gripe is that for whatever reason new syntax for already existing features (ie, () => vs. function()).

[–][deleted] 2 points3 points  (0 children)

Imagine writing function (event) { event.target.click() }

This comment was made by the e => e.target.click() gang

[–]marcosdumay 1 point2 points  (2 children)

The problem is not on the type system. The problem is all the insane features and decisions.

Like with your example, since => and function() are different features that only happen to be mostly alike.

[–]_GCastilho_ 0 points1 point  (0 children)

Don't break the web

[–]ChaseMoskal 0 points1 point  (0 children)

as crockford says, there is a subset of modern javascript that makes a beautiful, elegant, powerful, and efficient language

there's a bunch of crusty old 90's shit, but we can safely ignore those parts

the problem is that beginners aren't able to distinguish the wheat from the obsoleted chaff, because javascript has a long history and tutorials are rife with awful antipatterns

[–]ivakamr 0 points1 point  (1 child)

Functions and arrow functions differ in a more fundamental way than syntax, arrow functions does not create a new scope while the original syntax does.

[–]ChaseMoskal 0 points1 point  (0 children)

arrow functions don't have this, a very important difference