Re: C++ & gnome (was: Re: opening Gnome to multiple (windowing) systems)



  >> 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]