3 ms·
With all respect to this author and this piece -- it was well done and he makes many salient points. There are some topics on HN that are just starting to bore
by DanielBMarkham 16y ago
With all respect to this author and this piece -- it was well done and he makes many salient points. There are some topics on HN that are just starting to bore the hell out of me. Apple fanboy-ism, or not. C++: it's complicated so it's bad. Famous person X says this about famous person/product Y. And bitching about OOP.
Look. OOP is just the use of categorization and set theory to organize code and data. It doesn't have to involve a lot wiring things together, it doesn't have to mean tremendously huge class diagrams before coding, and it is absolutely not related to one particular language. I can use OOP techniques in any language, and to the degree they're necessary, I should. It's just a tool.
I understand that the OOP movement got way overblown and annoying, but we as technologist are always making overly-broad generalizations of anything we do. There's a tremendous amount of selection bias that goes on in technology, most of it hidden. I remember in one of my early contracting jobs we had a PM who was a FoxPro programmer. No matter what the problem we were talking about, somehow he would feel that FoxPro was the best answer for that problem.
At the time I thought he was unique -- sort of a joke. Looking back over many years of observing technologists, however? He was the rule, not the exception. At the risk of stating the obvious we only understand those things we have familiarity with. This means if you haven't programmed in OOP, or if you've had extensive experience with OOP and you know somebody at the same experience level with different opinions, you should try very hard to have an open mind and learn something from somebody else. It's very easy to make broad claims that are unsupported by anything but a small set of observations.
Saying "Are we still doing OOP?" is like saying "Are we still using categorization and set theory" which sounds to me a LOT like "Are we still using arithmetic?"
The question is nonsensical.
- plinkplonk 16y ago"Saying "Are we still doing OOP?" is like saying "Are we still using categorization and set theory" which sounds to me a LOT like "Are we still using arithmetic?"" OO is hardly equivalent, and not as fundamental (or anywhere near fundamental) as Set Theory, leave alone Arithmetic. The implied equivalence is misleading. You can use "categorization" and Set theory to design programs with never an Object in sight. Types and (mathematical) functions are both defined using Set Theory as are Relations (as in relational databases). You could program in Haskell with only types and functions and monads and such with no "object oriented design". The primary difficulty for people who've only done (what some call) "OOP" is forgetting all the OO technique they learned. At best you could say that objects (for various definitions of "OO") could also be expressed with Sets and (mathematical) functions and such. ALmost every programming language feature could be so expressed, that isn't saying much. There is no specifically "Object Oriented" super technique that transcends all languages (both OO and non OO) and is applicable in all of them. You'd be cutting against the grain of many languages if you tried to think in OO while using them. LIke Fortan, you can write "OO" in any language and it isn't always a good thing to do. Not defending the author of TFA ( I don't read these "Ohh technique X or language Y is so outdated" type of articles any more) but the sentence quoted (' "Are we using OO" is lik e "Are we using Set Theory" ') is as generic and misleading as anything the author claimed. Balance in all things.
- DanielBMarkham 16y agoClarification: you don't need an object to do OOP. Here's a wonderful example. Let's say you're in C. You start writing code and continuously refactor as you go along. What most people find is, after a good bit of coding and refactoring, you end up with code grouped in modules with public and private functions, public and private data, etc. You can have data abstraction, encapsulation, modularity, polymorphism, and inheritance -- all to varying degrees, depending on the problem and solution. OOP takes that categorization and set work and makes it part of the language. But programming in objects -- true OOP - does not require a language that provides objects. In fact, it's the other way around: because people programmed in objects, languages started providing that capability. Where folks get lost in the woods is where they think the language features are OOP instead of the conceptual work. Languages are just varying levels of syntactic sugar on top of the core tools. Hope that clears it up for you
- plinkplonk 16y ago" But programming in objects -- true OOP - does not require a language that provides objects. " Without getting into some mystical definition of "True OOP" You don't need any OOP to program or design. "data abstraction, encapsulation, modularity, polymorphism, and inheritance" None of these things (except inheritance maybe) is specific to OOP. All of them occur in all kinds of languages and paradigms with no objects or "OOP". As to " (with C programs) after a good bit of coding and refactoring, you end up with code grouped in modules with public and private functions, public and private data, etc. you end up with code grouped in modules with public and private functions, public and private data" Sure if you refactor that way. You could also end up with a collection of rules (as in Prolog) , polymorphic types and functions (as in Haskell), communicating processes (Occam/Erlang) etc with no "OOP" anywhere. (unless you want to claim any and all use of polymorphism or abstraction of any kind is indicative of some kind of all pervading mystical "True OOP" technique. There is no "True OOP" underlying all use of (say) abstraction or polymorphism). I think people who've done only OO or primarily OO are as bad as people who've never done any OO or rarely do any OO in making outrageous claims. Grandiose claims opposing or favoring specific subsets of programming technique [ example 1 --> "Are we still using OO?WTF" example 2 --> "Saying are we using OO is like saying are we using Arithmetic" don't stand up to scrutiny. Objects are a useful abstraction. So are functions, logic staements, relations, processes, polymorphic types .. . Each in its place. (and balance in claims ;-) )
- loup-vaillant 16y ago> It's just a tool. Please don't use that rhetoric trick. That sentence is both very close to a tautology, and bears a strong connotation of pragmatism. It says nothing, yet it proves anything. Also, I don't like this sentence especially in the context of programming languages. Programming languages and context are ways of thinking. As such, they have far more influence over us than the proverbial hammer. Saying they are just tools tend to deny that influence.