1
🔥 Discussion 🔥 ES6 Classes. Good or Evil?
(programming.dev)
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Follow the wormhole through a path of communities !webdev@programming.dev
I don't like/use the
class
keyword in JS, because I quite like the paradigm with prototypes & stuff, and that keyword tries to make it fit into a totally different paradigm, which doesn't really work IMHO.With TS, I find it even more useless, because I can use TS as a functional language, with POD, functions and interfaces only. I've written entire projects without ever using and needing this keyword, which is a proof IMHO that it's an unnecessary addition. Not sure how unpopular is my opinion tho 😅
BTW, I've developped a few strats to have my own style in TS that I like quite a lot. I can tell more if you're interested.
I've read somewhere that Javascript is more of a prototype-oriented language rather than an object-oriented one. Do you agree with this?
Thank you! But maybe not right now; I'm still learning the basics. Have you considered write an article about it? 😮
JavaScript is a prototype-based language. The class keyword uses prototypes.