• 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: [ANN] Cocoa Style for ObjC: 1 and 2
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ANN] Cocoa Style for ObjC: 1 and 2


  • Subject: Re: [ANN] Cocoa Style for ObjC: 1 and 2
  • From: The Amazing Llama <email@hidden>
  • Date: Wed, 27 Oct 2004 13:00:19 -0700

On Oct 26, 2004, at 5:40 PM, Scott Stevenson wrote:
I would argue against this because "each" (in English context, anyway) isn't free-standing. It has an implicit relationship with the many. In other words, this looks weird to me:

[array addObject: eachName];

It reads as "add each name to the array" which isn't what it's doing.

This is very AppleScript-y, and it makes sense there, because you ARE in fact adding eachName to the array. For instance
repeat with eachName in someList
add eachName to theArray
end repeat

That makes perfect sense, even if it's not actually very helpful here. I would argue that the equivalent ObjC makes just as much sense. However....

Maybe even "currentName" would be better, as it would say "add the current name to the array":

[array addObject: currentName];

I usually do this instead, because it "expands" easier. After you define "current" it is relatively simple to add in a "previous" and a "next", if need be, but you can't really do so with "each" or "one".

Seth A. Roby The Amazing Llama < mail or AIM me at tallama at mac dot com>
"Life is like an exploded clown. It's really funny until you figure out what just happened."

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: [ANN] Cocoa Style for ObjC: 1 and 2
      • From: Scott Stevenson <email@hidden>
References: 
 >[ANN] Cocoa Style for ObjC: 1 and 2 (From: Scott Stevenson <email@hidden>)
 >Re: [ANN] Cocoa Style for ObjC: 1 and 2 (From: Marco Scheurer <email@hidden>)
 >Re: [ANN] Cocoa Style for ObjC: 1 and 2 (From: Scott Stevenson <email@hidden>)

  • Prev by Date: [Solved]RE: Re: Populate a NSPopupButton with ascii
  • Next by Date: Re: Cocoa Java futures, NDA's etc
  • Previous by thread: Re: [OT] Re: [ANN] Cocoa Style for ObjC: 1 and 2
  • Next by thread: Re: [ANN] Cocoa Style for ObjC: 1 and 2
  • Index(es):
    • Date
    • Thread