4 ms·
Just to add on to that. Very few programmers know the prior art wrt. OOP, or have worked with the kind of code in which OOP is done well (I guess "OOD", using
by trgn 8y ago
Just to add on to that.
Very few programmers know the prior art wrt. OOP, or have worked with the kind of code in which OOP is done well (I guess "OOD", using the terminology from the article). Instead, almost all junior (even senior) programmers I encounter parrot something along the lines of OOP being too enterpris-y and crufty, and something about inheritance being stupid. OOP is dismissed out of hand. It's high time for a correction in that mindset. The ability to structure your data and the operations on that data together in place is incredibly powerful, and OOP is a good approach to do that.
Schools are partly to blame. They teach OOP as if it is an exercise in abstracting some sort of reality (e.g. "a dog barks, a cat meows, and both walk"). But that approach falls apart for the sort of concepts programmers work with. OOP is at its core a way to structure code, and to do so cleanly, to avoid repetition, and to enable easy navigation through a program. It is not intended to be mental map of some external reality.
- discreteevent 8y ago>The ability to structure your data and the operations on that data together in place is incredibly powerful. Agreed. In a lot of cases if you don't have objects (the good parts) you are doomed to reinvent them: https://www.cs.cmu.edu/~aldrich/papers/objects-essay.pdf https://www.cs.cmu.edu/~aldrich/papers/objects-essay.pdf "Linux uses service abstractions in order to support multiple file systems. There are vtable-like structures such as file operations that are used to dispatch operations such as read to the code that implements file reading in a particular driver."
- blarg1 8y agoI don't really see a problem with reinventing things when you need them. Classes etc are just syntactic sugar on top of functions and structs.