Hacker News new | past | comments | ask | show | jobs | submit login

"OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. It can be done in Smalltalk and in LISP. There are possibly other systems in which this is possible, but I'm not aware of them."

Such a pity that this filtered essence about OOP was lost on me during formative years of learning OO-programming; for no fault of mine! It took me half a decade into professional programming in Java to realize the importance of these key concepts.

And the worse part is that most of the books/blogs start OO programming tutorial with examples that try to literally model the problem state using Objects (e.g., "Animals", "Shapes" etc.,).

I guess tutorials, classes just focus on these key goals and show how concepts such as "polymorphism", "inheritance" etc., are work towards achieving (or not) them. What generally happens is that one is taught about all these peripheral concepts and students are left to wonder the problems they are trying to solve.




Those examples worked really badly for me too. It wasn't until about a year after I got my first paycheck for writing code that I made this switch in my mind. My thought process started out something along the lines of "ok, i just need to get all these things in line... somehow... and then I can accomplish the goal". However at some point I realized, I did some similar things quite often, and I needed to make some piece of code kind of generic. My mindset kind of changed dramatically. Instead of thinking about how I could make something work, I started to think of how I'd like the API to look. How could I make the code reusable. I thought about the perspective of another dev using the code rather than the goal itself, since that eventually became the easy part.

Once you start thinking in terms of the API, and how you can design it so someone with minimal documentation could still use it (though you still document it!) you start wanting to hide the implementation etc, and all the other OOP ideas fall into place.

of course, I don't think it's something that can be taught. It's an evolution. When you first start programming, everything is unknown, so you don't have the brain power to focus on design. When you learn more, and you free up brain power you can start concentrating on these other things.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: