"In all other languages we've considered [Fortran, Algol60, Lisp, APL, Cobol, Pascal], a program consists of passive data-objects on the one hand and the executable program that manipulates these passive objects on the other. Object-oriented programs replace this bipartite structure with a homogeneous one: they consist of a set of data systems, each of which is capable of operating on itself." - David Gelernter and S…
Ask HN: can you summarize OO for me in 64 words or less?
61–70 of 76 posts
Re: Ask HN: can you summarize OO for me in 64 words or less?
#62I remember my first class. It was a Stopwatch. It had start, stop, reset, and read methods. It maintained an internal counter by calling time(2) or something like that. A lot of objects have no real-world equivalent (they are not "objective", I kill myself), but that doesn't make them useless. Objects are an odd mash of concepts: inheritance, interfaces, global data with limited access, encapsulation, memory manageme…
Re: Ask HN: can you summarize OO for me in 64 words or less?
#63(I'm not trying to sound condescending, so bear with me) How else would you write software with modular and re-usable components?
I've got 8 minutes til I need to catch the bus. The answer to your question hinges mainly on how you define components. In the Erlang language for example: It is completely functional but threads actually become somewhat stateful and ultimately end up recreating some similar scenarios for OOP programmers. On top of that, functions themselves showcase an even higher amount of reusability at times especially in functio…
Clearly you're inexperienced with golden hammer methodology, which provides both a mightier paradigm and a pleasantly horned helmet.
Re: Ask HN: can you summarize OO for me in 64 words or less?
#64Earlier quoted context omitted.
The smalltalk object system is a nice simple example: A Smalltalk object can do exactly three things: Hold state (references to other objects). Receive a message from itself or another object. In the course of processing a message, send messages to itself or another object. http://en.wikipedia.org/wiki/Smalltalk#Object-oriented_progr...
The language that fits this description best is Erlang, I would say ... (what, in this definition, is specific to objects compared to processes?)
Re: Ask HN: can you summarize OO for me in 64 words or less?
#65Think of it less as "Object-Oriented" and more as "Message-Oriented" and things become clear. Every object has a vocabulary of messages it can respond to. The only contract you have with the object is what it can do, not how it does it; therefore, the supplier of the object is free to implement algorithms as he sees fit. (60 words) Bonus analogy: The web itself is object-oriented. You ask a server to return a resourc…
O.O is useful to you because it makes it easier to understand your code, especially if your code base becomes very large. You can look at your code object by object rather than line by line.
O.O is useful for group projects because each member can code an object and the algorithms behind its methods individually. It also makes it easier to swap different functionality in and out.
Finally, O.O also promotes good coding practices, like reusing existing code and writing documentation. It also makes you think about your code's structure, which is crucial to keeping your code maintainable, upgradeable, readable, and reusable.
For me, writing good O.O code is a something that I learned after writing a lot of bad O.O code. So there's no reason to delay - write it and you'll see.
Re: Ask HN: can you summarize OO for me in 64 words or less?
#66Re: Ask HN: can you summarize OO for me in 64 words or less?
#67This is probably the wrong community to mention this, but this discussion is an excellent example of why I am largely procedural in my programming and don't focus too much on OO. I need to tackle real world business problems. Likening objects to things like refrigerators and toasters is where I get lost. Perhaps those examples work well in the classroom to help kids wrap their heads around the concept of OO, but I ju…
Likening objects to things like refrigerators and toasters is where I get lost. Perhaps those examples work well in the classroom to help kids wrap their heads around the concept of OO ... I have sometimes thought the same thing. There are ample explanations of the use of OOP put in terms of stuff like, poodle inherits from dog, which inherits from mammal etc. or a car could be represented as a series of objects inte…
"All of these objects do very similar things. I don't want to have to write these functions over an over again if they're so similar..." and inheritance was born.
Most OO concepts are about writing and seeing less code. I think the best way to grasp OO is to ban ctrl+c for anything longer than 2 lines. It really forces you to think about structure and code reusability, which is what OO is all about.
Re: Ask HN: can you summarize OO for me in 64 words or less?
#68"In all other languages we've considered [Fortran, Algol60, Lisp, APL, Cobol, Pascal], a program consists of passive data-objects on the one hand and the executable program that manipulates these passive objects on the other. Object-oriented programs replace this bipartite structure with a homogeneous one: they consist of a set of data systems, each of which is capable of operating on itself." - David Gelernter and S…
Yes, but the writing is poor. 'bipartite' and 'homogeneous'? Would you speak to your non-academic friends that way? If not, it's not going to successfully convey the message to a wide audience.
Re: Ask HN: can you summarize OO for me in 64 words or less?
#69This is probably the wrong community to mention this, but this discussion is an excellent example of why I am largely procedural in my programming and don't focus too much on OO. I need to tackle real world business problems. Likening objects to things like refrigerators and toasters is where I get lost. Perhaps those examples work well in the classroom to help kids wrap their heads around the concept of OO, but I ju…
Likening objects to things like refrigerators and toasters is where I get lost. Perhaps those examples work well in the classroom to help kids wrap their heads around the concept of OO ... I have sometimes thought the same thing. There are ample explanations of the use of OOP put in terms of stuff like, poodle inherits from dog, which inherits from mammal etc. or a car could be represented as a series of objects inte…
Re: Ask HN: can you summarize OO for me in 64 words or less?
#70Earlier quoted context omitted.
Yes, but the writing is poor. 'bipartite' and 'homogeneous'? Would you speak to your non-academic friends that way? If not, it's not going to successfully convey the message to a wide audience.
"two part structure" & "single structure?" Ups the word count to 62
"Programming by making things that can be interacted with in different ways"