Why OOP rocks
I started learning programming with python. Python is a beautiful language, but object-oriented programming felt weird to me. I eventually stumbled on an object-oriented hate video on YouTube (the popular brian will one).
I drank the functional programming kool-aid, functional programming looked cool and hip. It felt familiar to me, with a similar syntax to math. Enums felt intuitive, and all those functional programmers were so dahm loud in insisting that functional programming was the best thing since sliced bread. And that OOP would go the way of the dodo.
I then took a class in OOP, and it further cemented my dislike for OOP. We used Java, and it was unsurprisingly a nightmare. The examples used in class were silly and contrived. The design patterns felt useless.
Then I started coding. I'm a bit obsessed with code quality and readability. Often writing the same code over and over again, trying to make it simpler and more readable. Over time, I started to use more and more OOP concepts in my code. I learned Rust, Swift, Scala, and Kotlin and suddenly every time I would help my friends with their code, I would find myself explaining this or that OOP concept (despite them all taking the same exact courses as me).
I started to realize that OOP just had a marketing problem. It was a victim of its own success. It wasn't cool anymore, and as any coding concept becomes more popular, the quality of online content goes down (As spam website clogs the air with manufactured content).
goal of the following dialogues
The following is an imaginary dialogue between me and my past self. My goal is to explain OOP concepts that cover real-world use cases that I have encountered in my coding journey. I'm going to do my best not to cherry-pick examples, and too not caricature people who disagree with me. Coding is hard, and I believe that OOP is an incredibly powerful tool that can help you write better code. Both for yourself, but much more importantly in creating API's that are usable by other people.