|
|
|
Ask HN: HMH anti-OOP movement
|
|
4 points
by RoboSeldon
3971 days ago
|
|
For some time I follow handmadehero.org where Casey Muratori teaches how to implement a game from scratch (no libraries). I have some trouble conciliating what he (and other people that follow him on Twitch) teaches about OOP with what I've learned in school. Basically they claim OOP is bad, that most C++ is horrible (especially OOP), that the new C++11/14 is unnecessary and that we all should use the C++ compiler to code in a more C like style. It is particularly troubling to hear Casey and his disciples denigrating books like "Effective C++" etc ... that are widely accepted in the C++ community. I don't want to start a flamewar C vs C++ on HN, but I was wondering what is your opinion about this anti-OOP movement. |
|
I'm far from being a fan of Casey. I find that he makes strong statements based on weak arguments. He's overly hateful of Microsoft and C++, despite him using Visual Studio and a C++ compiler. He tries to be pedantic but makes a fair share of mistakes. Some of his architecture design choices left me with a straight face wtf expression.
C++ has it's flaws, that's widely known and accepted by the community. It's even highlighted in the "Effective C++" books. Unfortunately, the best advice given is "don't do that". I believe a vast majority of C++ users will gladly switch to a new language that offers the same level of abstractions at a comparable speed (maybe Go or Rust). For now, C++ users have to understand the language well enough to avoid its many traps and pitfalls. Moreover, new versions of the standard add to this burden. I know of no project built entirely using C++14. People will always have to deal with legacy code.
OOP is just another programming paradigm C++ supports. You're not required to use it, and you're not even paying for it if you're not using virtual methods. Sure, C++ allows you to do a lot of funky things from overloading operators to implicit conversions but that's another of those things everybody agrees should not be used unless explicitly necessary. OOP facilitates encapsulation and polymorphism which are great tools when designing software systems.
C has its elegance and simplicity. C++ has its abstractions and pitfalls. There are always tradeoffs.