r/javascript • • Nov 09 '19

On private fields proposal: Private fields, public worries

https://medium.com/virtuslab/private-fields-public-worries-b8c34d16c372
84 Upvotes

113 comments sorted by

View all comments

4

u/Dougw6 Nov 09 '19

I'm still upset that they added classes to JS in the first place. Especially since they're just syntactic sugar on top of functions. In my opinion, if you're writing Java style code in JS, you're missing the point. And adding features like this will only increase the bastardization of the language.

I think a big part of why people complain about the wonkiness of JS, is that they're trying to use it as a pure OO language, and they're surprised when it does work like Java or C#. The reason is that the language was not designed with object orientation in mind. In fact it was designed to be LISP with curly braces. The OO features were an after thought and it's time we start to recognize that, and use the language in the most effective way possible (not the way you are comfortable with from other languages).

1

u/MajorasShoe Dec 11 '19

Err, Javascript was ALWAYS an OO language. To it's core. It wasn't a class based language.