Re: newbie questions about objective-c, ruby, python, groovy and cocoa
Re: newbie questions about objective-c, ruby, python, groovy and cocoa
- Subject: Re: newbie questions about objective-c, ruby, python, groovy and cocoa
- From: Allan Odgaard <email@hidden>
- Date: Thu, 10 Jun 2004 13:06:40 +0200
On 10. Jun 2004, at 12:37, Andreas Mayer wrote:
if([str isEqualToString:otherStr])
or
if([num compare:otherNum] == NSOrderedAscending)
I *love* the verbosity. It makes code so much more readable.
Seriously, is the above more readable than:
if(str == otherStr)
if(num < otherNum)
Likewise for:
[dict setObject:someObj forKey:@"foo"];
versus
dict["foo"] = someObj;
That of cause is all about lacking operators... I guess for the actual
method names, like 'stringByDeletingLastPathComponent', I don't mind it
as much... only when methods are cascaded, so I end up sending a method
to the result of a method sent to the result of a method, and my line
is 120 columns, but the logic is rather simple, e.g. index the array
with the numeric value of an object in a dictionary... ;)
For the records:
[array objectAtIndex:[[dict objectForKey:key] unsignedIntValue]];
And since Xcode provides a nice auto completion feature, the typing is
not much of a problem. :)
It certainly is for me! :)
_______________________________________________
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.