Object-Oriented Programming Is Bad
youtube.com
youtube.com
Just another variant in the "Why the 'else' statement is bad" genre, this video.
I'd say maybe 50% of application code I see (not write) are web UI/clients. Something like React with OOP components work very well. Same goes for mobile or UI's in general. The argument would be more persuasive if it used a more common definition of OOP and concrete examples of both good and bad applications to show which kinds of cases fit and which don't.
I like oop because of custom types. Awhile back I had to create a vector class in python. Since Python support type hints, vscode automatically warned me if I pass the wrong object.
I have seen the results of this in open source libraries with insanely complex object structures that can often be reduced down to very few lines of procedural code. The most extreme case of this I have seen was a serial communications library for Arduino. I showed this to my son, who, at the time, was in the middle of his CS degree journey. After understanding what the library did, I rewrote it in four lines of code.
The other aspect of this issue is performance. Being that quite a bit of my work for over 30 years has been focused around real-time hardware, embedded systems and robotics, performance has always been at the top of my list. OO can be absolutely horrific in this regard.
I remember writing an iOS application back in iPhone 3 days, which meant Objective-C. I used all of the native object data types and kept it to Objective-C. The performance was absolutely horrible and unusable. The application was based around a genetic solver. It needed to run thousands of generations fast, as fast as the user clicked on a button. Well, that wasn't happening at all. I re-coded the entire thing procedurally and got rid of every single object data type and calls to encapsulated object functionality. The genetic solver ran nearly 400 times faster with a marked reduction in resources.
Of course, my journey through programming has been very different from what students experience today. I started with machine language, then moved to assembler, C, Forth, LISP, APL and beyond. C++ came into my life after these languages had been part of my work for years. Exploding a codebase into nearly incomprehensible hierarchies of inheritance and polymorphism-laden classes made little sense to me at the time. Yet, I dutifully jumped on the bandwagon and adopted the cult at the time.
It didn't take long for me to privately think "this is bullshit" and, eventually, express the opinion in a more public form.
I can't remember the last time procedural programming has prevented a project to be completed on time and with the requisite functionality. This spans consumer to industrial and aerospace projects. I will use OO when absolutely necessary and justified. If you are using Django and have to create class-based views, well, enjoy. On embedded systems? Not necessarily.
I know this is likely to be controversial. When you have a whole generation of people for whom the first thing they type on a fresh source file after some imports is "class", well, they might just not be equipped to understand they don't have to. That's just reality.