Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Other commenters here have covered the theory well so I'll take the practical angle. OO in practice means Java and C#: procedural languages that make you organize your code as a collection of "classes", which means files. A class is a collection of related functions that you get to use after calling a "constructor", unless they're "static". Also a class can contain some data that's easily accessible to functions in this class; other classes can access it with "getters and setters", which is called "encapsulation". One class can "inherit" from another, giving you a more convenient syntax for calling functions in the "parent" class at the price of a little confusion for everyone reading the code.

People 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.



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

Search: