Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I too think the OO paradigm, at least as implemented in popular OO languages (mainly through classes and inheritance), has few benefits, though not necessarily none. Certainly the idea of modeling real world objects has failed miserably while still being taught to inexperienced developers who then make everything a descendant of a class like Thing (or some nonsense like that). On the other hand, interfaces (protocols in Clojure) are the one good idea that's implemented in a lot of OO languages, though really that's just part of a type system and not an OO concept.

The real problem comes from completely ignoring data structures. By mixing in functions with data, proper data structures are virtually nonexistent in the OO world and manipulating data properly becomes an exercise in frustration and working around the limitations of the OO implementation (data that should be together isn't; data that shouldn't be is; easy access to the data, etc.). In this regard, I'd say procedural programming is on roughly equal footing with functional programming in as much as they both tend to focus heavily on data structures first. As they say, show me your data structures and I don't need to see the code; show me your code and I won't know shit.

Your point that OO's main advantage is popularity is spot on. It certainly is possible to build large, maintainable systems in an OO fashion, but it is very difficult and requires a lot of experience. That's why there is so much terrible OO code out there. It's virtually impossible to write decent code without a lot of experience. This mammoth learning curve is not as steep in languages that focus on data structures first, whether they be procedural or functional.



Oddly enough, I find that good OOP codebases often converge toward an FP-ish approach (little or no inheritance, focus on objects-as-records and "static" services, emphasis on immutability and "result" types).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: