News for hackers. Stuff that matters.
Re:Love this essay, I still can't (don't want to) find an ap... by mojuba on Friday June 15, 2007 @06:10PM (#28452)
OO is good for you as long as you are not trapped into all-OO thinking.

In bad code you can see, for example, a lot of duplication (literally copy and paste) of some small 3, 4, 5-line pieces only because a coder was too lazy to declare another method in the class. In fact in most of such cases a simple static function was needed, not a method. These coders are usually surprised to hear that static/global functions aren't bad, if not best.

Bu that's, of course, is not the only problem with OO.

Re:Love this essay, I still can't (don't want to) find an ap... by kingkongrevenge on Saturday June 16, 2007 @02:07PM (#28564)
C++ has a healthy relationship with OO.

"The aim of the C++ class concept is to provide the programmer with a tool for creating new types that can be used as as conveniently as the built-in types. [...] A type is a concrete representation of a concept. For example, the C++ built-in type float [...]" --Stroustrup

This emphasis on concrete types is how I use and think about objects. If it doesn't cleanly act like a concrete type, I prefer to write a library that provides the data structures and related functions separately to the user. I hate how languages like Java shoehorn EVERYTHING into objects. It's very useful to keep the distinction between what cleanly forms a type and what doesn't.

Re:Love this essay, I still can't (don't want to) find an ap... by fallintothis on Saturday June 16, 2007 @06:52PM (#28600)
In my spirit of hiding behind one-off quotes:

"I invented the term Object-Oriented, and I can tell you I did not have C++ in mind." - Alan Kay

Re:Love this essay, I still can't (don't want to) find an ap... by mojuba on Saturday June 16, 2007 @10:52PM (#28615)
Agreed, and besides, you can think of objects as tiny modules with isolated names spaces and an additional feature: you can have multiple instances of a module in one process, which isn't possible otherwise in C/C++.