Re: C++ & gnome (was: Re: opening Gnome to multiple (windowing) systems)
- From: larsbj ifi uio no (Lars Gullik Bjønnes)
- To: Miguel de Icaza <miguel nuclecu unam mx>
- Cc: bruce triphop dyn ml org, cj styx phy vanderbilt edu, gnome-list gnome org
- Subject: Re: C++ & gnome (was: Re: opening Gnome to multiple (windowing) systems)
- Date: 15 Apr 1998 15:17:14 +0200
>> Miguel de Icaza writes:
[...]
MdI> example:
MdI> gtk_label_set (l, "string");
MdI> Which describes precisely the action being performed.
MdI> The C++ way of doing this is:
l-> set ("string")
MdI> Which leaves us with the question of what exactly is "l" and
MdI> what is the "set" doing there.
MdI> Now, Objective-C goes one step beyond -in the right direction-
MdI> and lets you do:
MdI> [l setString: "string"]
MdI> Every parameter gets a name, so you always can figure out what
MdI> is going on, like in:
MdI> [l setString: "string" withFont: lucida withSize: 5];
MdI> Ok, it was a bad example, but nevertheless, it points a nice
MdI> feature of Objective-C.
You said it yourslves...bad example...
- You are allowed to use a vaiable name with some meaning (l? l what?)
- even method names might be choosen to give meaning (setLabel - perhaps?)
(one Q about Obj-C is the "String" in setString the type of the
argument?)
Lgb
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]