• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: newbie questions about objective-c, ruby, python, groovy and cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: newbie questions about objective-c, ruby, python, groovy and cocoa
      • From: Andreas Mayer <email@hidden>
References: 
 >Re: newbie questions about objective-c, ruby, python, groovy and cocoa (From: "KlunkyRobot" <email@hidden>)
 >Re: newbie questions about objective-c, ruby, python, groovy and cocoa (From: Allan Odgaard <email@hidden>)
 >Re: newbie questions about objective-c, ruby, python, groovy and cocoa (From: Andreas Mayer <email@hidden>)

  • Prev by Date: Re: Making Returns stop Editing
  • Next by Date: Re: newbie questions about objective-c, ruby, python, groovy and cocoa
  • Previous by thread: Re: newbie questions about objective-c, ruby, python, groovy and cocoa
  • Next by thread: Re: newbie questions about objective-c, ruby, python, groovy and cocoa
  • Index(es):
    • Date
    • Thread