DEV Community

Discussion on: How to write 90% cleaner code with Hooks 🎣

Collapse
 
gerardolima profile image
Gerardo Lima

classes can be hard, but only without a proper type system; it's been interesting to see javascript development going round in circles saying types are not necessary and re-implementing over and over again on half-baked solutions

Collapse
 
aman_singh profile image
Amandeep Singh

Personally, I feel that we should just let the JavaScript be how it is designed to be: Prototypal Inheritance and Functional Programming. No need to mimic the OOP mental modal as internally they are just syntactic sugar over functions.

Collapse
 
gerardolima profile image
Gerardo Lima

i didn't say anything about OOP -- although, as FP, it provides good patterns and techniques that can be applied to javascript -- my point was about using classes in javascript and about it being "hard"; it is not, you just need a proper type system, as typescript; but react folks usually are not keen to the "overhead" and keep hitting their heads into the same walls