|
>What baffles me about OOP is that massive aspects of how to use it have changed, and that change happened after it gained popularity as a good technique. How could it have become popular when people were doing it wrong? Your arguments boils down to "how come something that had utility X at some point in time, have less than X at a later point", which frankly I don't think is surprising at all, nor logically contradictory (which seems to be the assumption). How is that surprising? It happens with most emerging programming paradigms/technologies. They first get popularity for some new benefits they bring, and then, as the dust settles, the community finds out the best ways to do something, shapes their best practices etc. Two examples: 1) JAVA. Initial lure: runs anywhere, easier to use than C/C++, fast, etc. Java, then went through the crazy J2EE, XML everywhere, etc phases, and after that they found a balance on how you should write code, including adopting more functional styles now. 2) PHP. Initial lure: dead easy to install, comes with every function webdevs needed at the time, runs on all cheap hosts, easy syntax. Community used crappy coding practices, bad idioms etc, but slowly improved their ways, found new ways to structure code, etc. >So if OOP was great with inheritance and heavy classes, how can it now be bad with inheritance and heavy classes? That was then, and this is now. Neither CPUs, nor the available programming languages, nor needs, nor our collective understanding of programming is the same. The same way "Finding Nemo" might be good when you're 10 (and given your other options at the time), but at 30 you have a lot more movie options... 1) CPUs: are now multicore, and OO is NOT the best way to get advantage of them (push towards pure, functional, etc). 2) Available programming languages: then, at least the mainstream ones where ...assembler, plain Pascal, C, etc, compared to which OO was a novel and handy way to structure programs. Now we have much more options. 3) Needs: back then --80s, 90s-- it was the golden age of Desktop GUI programming, for which OO is a quite good match. For web programming and the kind of work we do now, not so much. 4) Collective understanding of programming: back when a closure was something exotic, and functional concepts totally alien to most programmers, even OO was too foreign for some, but at least they understood it. So it was a good match for the average programmer then. Nowadays programmers come out of universities, or learn on their own with the millions of internet resources, and have a match better understanding of programming idioms, exposure to new ways to code, etc. |