Ask HN: can you summarize OO for me in 64 words or less?
71–76 of 76 posts
Re: Ask HN: can you summarize OO for me in 64 words or less?
#72This is more cohesive than parallel hierarchies of data structures and code that must be kept in sync.
(63 words)
Re: Ask HN: can you summarize OO for me in 64 words or less?
#73People with advanced OO skills use clever techniques to write interesting programs. For example, sometimes we want to give a class (technically, "an object of the class") to other programmers without letting them know which class we gave them. To achieve this goal, we give them another class with a function to generate objects of the first class without telling them which one. If you have trouble following, don't miss the helpful diagram: http://en.wikipedia.org/wiki/Image:Abstract_Factory_in_LePUS... An award-winning book of twenty-three such techniques is required reading for good OO programmers.
So your gut feeling is right.
Re: Ask HN: can you summarize OO for me in 64 words or less?
#74Earlier quoted context omitted.
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…
Try to go through the articles at: http://www.objectmentor.com/resources/publishedArticles.html Most articles carry some example to go with the concept being explained.
Regarding inheritance, I once had a conversation with a "application architect" who advised staying away from inheritance until you fully grok it, because it's easy to paint yourself into a corner with it (he then disappeared before I could question him further). The only issues I could think of at the time was stuff like say you have a bird class which contains a "fly" method, with duck and emu child classes (now I'm using the dodgy animal examples :P), the duck and most other birds should be able to fly, but the emu and some others should not. What is the better practice way of dealing with this issue? And what other adverse issues can arise when using inheritance?
It has been recommended to me in the past that when it comes to systems that require more abstract objects, this is where researching design patterns would assist. However, pretty much all the design pattern literature I can find is not directly related to my current language of choice, Ruby. I can find lots of stuff talking about design patterns in Java and whatever else, which still provides some utility, but is there any books/articles that anyone can recommend on design patterns etc. using Ruby?
Re: Ask HN: can you summarize OO for me in 64 words or less?
#75What 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.…
So, you mean, "no". ;)