C vs C++ vs Lisp (156)

150 Name: #!/usr/bin/anonymous : 2008-08-26 21:04 ID:Ixw2SuFv

>http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht81Ht/doc_kay_oop_en

HTTP/1.1 403 Access Denied.

Wow, that site doesn't like 4-ch

Google: alan kay object oriented programing definition
first result

>First of all, C++ programmers don't do that.

That is true, they have to implement extra features of the language to use objects properly.

Lets say I want to paint my house.

class Person {
void Paint(House houseToPaint) {

  ...

}
...
}

class House {
...
}

Person me;
House myhouse;

me.Paint(myhouse);

So what did I just do. I created a new house, painted it and destroyed my new house resulting in my actual house not being painted. Damn the language sucks at working with objects. Lets try what someone else wanted to do...

class Person {
House Paint(House houseToPaint) {

  ...

}
...
}

class House {
...
}

Person me;
House myhouse;

myhouse = me.Paint(myhouse);

Not too bad, I only had to change a few things. But what did I just do? I built a new house just like the old one, moved in to it, painted it, and destroyed my old house.

Clearly, that is more work that I wanted to do.

Lets do something seemingly more practical.

class Person {
House Paint(House* houseToPaint) {

  ...

}
...
}

class House {
...
}

Person me;
House myhouse;

me.Paint(myhouse);

Success! My house is painted without extra steps. All I had to do was type an asterix (or I could have even done an ampersand).

The thing is, why does the language want me to work with myhouse with value type semantics in the scope is was declared and then implement reference type semantics myself when passing to another scope. The language should be oriented towards working with objects. The language clearly supplies me with the mechanisms to do so. But it is left up to me to implement those mechanisms each time I want to work with the object in a practical manner (which is using the instance of the object when I want to work with the instance of an object).

If I am working with objects, I will be working with instances of those objects. The language wants to create a new completley new and unquie instance unless I tell it not to. If the language was oriented to working with objects, when working with an object it should always use the instance unless I tell it not to.

Yeah ,its just a simple astrix but it exposes the fact that the language does not treat object instances as unique entities. The programmer is left up to doing that on theri own.

This thread has been closed. You cannot post in this thread any longer.