Re: cocoa-dev digest, Vol 2 #3738 - 11 msgs
Re: cocoa-dev digest, Vol 2 #3738 - 11 msgs
- Subject: Re: cocoa-dev digest, Vol 2 #3738 - 11 msgs
- From: Glen Low <email@hidden>
- Date: Wed, 25 Feb 2004 20:42:03 +0800
On Feb 19, 2004, at 5:11 AM, Allan Odgaard wrote:
On 19. Feb 2004, at 11:29, Marco Scheurer wrote:
Arg... implementing algorithms in ObjC is certainly not something I
would recommend, not really for the performance overhead, but mainly
for the syntactic overhead [...]
Argh! I would have said exactly the opposite, ie one always want to
avoid the syntactic mess of C++. [...]
Not that I wish to start a flame war or anything, but would you care
to elaborate?
Another thing, hopefully not further adding fuel to another language
war, on the topic of ease of syntax...
The [ ] call syntax of ObjC still bugs me. Suppose I want to call
method alloc, so I start typing:
[NSArray alloc]
now I remember I have to call the method init on the result, so I have
to backspace or mouse back to the beginning of the line, put in a [:
[[NSArray alloc]
then forward space or mouse to the end, and put in the rest:
[[NSArray alloc] initWithObjects: a, b, c, nil];
On the other hand with the C++, Java and C# style:
nsarray.alloc ()
oops, need the init, so it is
nsarray.alloc ().init (a, b, c, nil);
all without backspacing.
I'm convinced that's why in C and C++ you have a->b as an alternate
form for (*a).b, just to save on programmer backspacings.
Cheers, Glen Low
---
pixelglow software | simply brilliant stuff
www.pixelglow.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.