3 ms·
And that has led us where. Class-based OO approaches became popular in the mid-90's as a panacea of maintainability and code reuse... This has taken us to "ent
by tracker1 14y ago
And that has led us where. Class-based OO approaches became popular in the mid-90's as a panacea of maintainability and code reuse...
This has taken us to "enterprise" frameworks and layers of abstraction that offer very little actual value, and huge amounts of maintenance overhead. In VS/Eclipse, I can't tell you how many times I go through the inheritance chain only to be brick walled into an Interface, and then have to look for the specific/abstracted implementation of said interface.
99/100 times there is only one implementation, and no test coverage to justify said abstraction. So, why do it at all? Because of how strict and constrained said programming environment is.
JS doesn't have those levels of restriction, and doesn't need those levels of abstraction and inheritance. You can utilize other patterns and practices... there's more out there than Class based approaches.
For example MVC is really seamless in JS... you can have models that are dumb JS objects (they don't need to be inherited from, or to).. and modules that manipulate/use/store said objects. It doesn't need to be so complicated.
It isn't that some problems aren't complicated, and don't need some serious use of patterns/factories/IoC... It's simply that in many cases they are done because they "can be" or some overzealous architect thinks they "should" be. I've only ever seen a couple instances where most of these abstraction patterns actually make sense.. and I've been writing software for close to two decades now.
As for "but the overwhelming majority of frameworks... use class-like approach" .. arguably the single most used framework/library in use today is jQuery.. and that definitely does NOT use a class-like approach.
- coldtea 14y ago>And that has led us where. Here. A thriving web, mobile and native application ecosystem. >Class-based OO approaches became popular in the mid-90's as a panacea of maintainability and code reuse. This has taken us to "enterprise" frameworks and layers of abstraction that offer very little actual value, and huge amounts of maintenance overhead. Yes, only that has nothing to do with the classes. You could do the same bloated mess of enterprise layer upon layer, XML configuration, boilerplate etc, even with prototypes, if anybody cared about them. And you can do perfectly clean designs, also with classes. Not even need to use Smalltalk, CLOS etc, you can even do them in Java if you take the necessary care. And lots of people do them in Python, Ruby, etc too. >JS doesn't have those levels of restriction, and doesn't need those levels of abstraction and inheritance. You can utilize other patterns and practices... there's more out there than Class based approaches. Nothing in using class based approaches necessitates those "levels of restriction, abstraction and inheritance". People use Coffescript (which has "classes") and do perfectly lean work, without it looking like Apache Struts or something similar. >As for "but the overwhelming majority of frameworks... use class-like approach" .. arguably the single most used framework/library in use today is jQuery.. and that definitely does NOT use a class-like approach. That's because it is a DOM manipulation library, not a code structuring library itself. And people writing plugins with fuller functionality on top of jQuery (as jQuery/jQuery UI plugins) have been using OO styles on top of jQuery since for ever.