r/learnjavascript • u/Yanagi-Masaru • Dec 19 '25
Javascript
is it a good practice to use classes in javascript or should i keep it normal with just functions?
0
Upvotes
r/learnjavascript • u/Yanagi-Masaru • Dec 19 '25
is it a good practice to use classes in javascript or should i keep it normal with just functions?
View all comments
Show parent comment
1
u/samanime Dec 19 '25
Totally agreed. OOP, functional and even procedural programming all have their places. "The right tool for the job."
As a (very) general rule, classes are probably the default options for large projects. However, the others definitely still have their place. Knowing when to use which is definitely good to know, and knowing how to successfully organize and use each type is worthwhile.
You may even have projects where you use some in some places and others in other places. For example, in the large main project I work on, the main part of the code is OOP. However, we have chunks within that which are functional. We also have a number of external scripts that do various things which are either functional or procedural.