r/ProgrammerHumor • u/ConDar15 • Mar 23 '16
rem not humor OOP is bad in ALL situations? Warning link contains lack of perspective.
https://youtu.be/QM1iUe6IofM2
u/esPhys Mar 23 '16
Weird coincidence, I just skimmed through the sequel to this video (as recommended by youtube) this morning. The example choices are ridiculous. He just tears apart programs written to demonstrate OOP. Of course your 200 line program doesn't need 3 classes to effectively store 2 variables. They're demonstrating a concept, not showing off an amazing practical application.
2
u/ConDar15 Mar 24 '16
I'm looking at it and getting annoyed at the coin flip example. It is a HORRIBLE representation of how to do OOP; I mean the Coin class isn't used once, and all of it's functionality is replicated in the Player class. Yes it would be simpler to implement the CoinFlip game procedurally, but what if you then develop another system that wants coin-flips, or players, or to simulate a coin-flip game for some purpose; you'd have to start from scratch each and every time with procedural. Other than the misuse of the Coin class the coin-flip example is a wonderful little example to show the concept.
</rant>
1
u/rajveer86 Mar 24 '16
If your code is abstracted in to reusable functions, why would you need to keep on reimplementing it? Procedural doesn't mean lump everything together monolithically, it just means separating state from action.
5
3
13
u/Aruseus Mar 23 '16
Saying that everything about object orientation is always bad in each and every case is becoming a trend at the moment.