|
|
|
|
|
by hajile
2998 days ago
|
|
In my experience, the class syntax has been more bad than good. Devs with experience in other languages simply start writing classical OOP code without realizing the ramifications of what they are doing. Unless you are creating thousands of rigidly structured instances (never adding/removing properties or changing property types), you are almost always going to be better off using the factory pattern instead where you get other benefits like no `new` and real privacy. |
|
Which are? And why is "no new" a benefit?
IMO it's a good thing that you can write JS in the way you write other languages. It makes it a lot easier for developers to get going with it.