2 ms·
My pet theory about the abundance of classes is that they only gained popularity because of their inherent complexity. There's no one, authoritative way to use
by keithasaurus 7y ago
My pet theory about the abundance of classes is that they only gained popularity because of their inherent complexity. There's no one, authoritative way to use them, so a bunch of people can went to conferences and wrote papers about SOLID or encapsulation, or whatever. So people thought there must be value in them.
It takes a long time for a lot of developers to realize anything you can do with classes you can do without. And if you structure your code without classes, it tends to be more refactorable because moving chunks of code in and out of different contexts is a breeze.
The only things I find potentially useful about classes are:
- portability (but you can get that with modules, caveat that not every language does modules well)
- auto-complete in a noun->verb context