re: What was the most difficult thing to learn about JavaScript for you? VIEW POST

re: For me, it is classes and OOP. I know the syntax, I know how it works. but I don't know where and when to use it. I have been coding in Express.js...

Use cases to use classes and OOP are rare in web programming. I mostly find my self creating a class, just to organize a set of functionalities, which are otherwise can be written as simple functions & put together as module.

While writing query builders, I had used classes & inheritance, where there are some low level methods which can be used from all the inheriting classes & inheriting classes would provide their functionalities using the low level methods.

Disclaimer: The code that I write are very simple ones.


Use cases to use classes and OOP are rare in web programming

If we are only talking about JS, I agree - but web programming also covers PHP, Ruby, Java, Python and many others, all of which are very OOP and utilize classes for almost everything.

Having said that, I too have written classes in JS, just to break it apart again later into simpler modules.

code of conduct - report abuse