Ask HN: can you summarize OO for me in 64 words or less?
31–40 of 76 posts
Re: Ask HN: can you summarize OO for me in 64 words or less?
#32Re: Ask HN: can you summarize OO for me in 64 words or less?
#33What is Object Oriented programming? I wrestled with this one in school for a while, because the name is so screwy. What is an object? It's a blob of code. It's a walled off place in your computer's RAM that has variables and functions. It's just a bit of reusable code. Why is that special? If you've spent your programming life copying and pasting code in a text editor, it's probably not going to be readily apparent.…
Re: Ask HN: can you summarize OO for me in 64 words or less?
#34Think 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…
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...
Re: Ask HN: can you summarize OO for me in 64 words or less?
#35Smalltalk is a great start. If you want to read more, this poorly named book is by far the best I've read on the topic: http://www.amazon.com/Software-Development-Principles-Patter...
Re: Ask HN: can you summarize OO for me in 64 words or less?
#36abstraction, hierarchy, modularity, encapsulation
manage complexity reduces resistance to change over time
design patterns give best practice advise
Re: Ask HN: can you summarize OO for me in 64 words or less?
#37Re: Ask HN: can you summarize OO for me in 64 words or less?
#38What can you do with a string? Set it, save it, match it. What properties does it have? Length, value, encoding, language, etc.
Object Oriented software is built with methods and properties.
(Do I get extra credit for using 64 words exactly?)
Re: Ask HN: can you summarize OO for me in 64 words or less?
#39(I'm not trying to sound condescending, so bear with me) How else would you write software with modular and re-usable components?
Hah! However you want!
The first few chapters of Paul Graham's `On Lisp' does a great job covering closures, which can provide elegant encapsulation. But even in Java or C++, objects aren't the only modular or reusable components - consider packages or name spaces, for example. Data types such as streams, arrays, and trees don't have to be classes, either - take a look at Haskell's data types.
Re: Ask HN: can you summarize OO for me in 64 words or less?
#40Earlier this was a garbled mess, full of functions like custID = addCustomer(form_info) updateAddress(custID, "Billing", some_args) and so on ...
On the flip side, OOP is trickier (b/c of encapsulation) to debug esp when object model gets complicated. In terms of programming the only way to do it better (and this is frankly v debatable, esp when you consider management of DB connections and API administration etc) is "LISP style", where you effectively concoct a DSL for your specific app.