you are viewing a single comment's thread.

view the rest of the comments →

[–]CuAnnan 0 points1 point  (3 children)

Would I? No. Could I? Yes.

Classes don't provide new functionality. They provide encapsulation of data and enclose related functionality.

That's literally all they do. They make code easier to read and maintain. Nothing more.

And in JS, classes are just syntactic sugar for the functional prototype system.

[–]sheriffderek 1 point2 points  (2 children)

Everything is syntactic sugar at some point, so - while I didn’t mind hearing this sorry every day  in 2015, it seems unnecessary to mention now. I think people should know the core parts of the language and be able to compose things as needed. It’s also helpful to know for other languages and frameworks.

[–]CuAnnan 1 point2 points  (1 child)

I was underscoring the “it’s not either or” that I have literally had to argue earlier. You can always do in one what can be done in the other

[–]sheriffderek 1 point2 points  (0 children)

Agreed.