• 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: cocoa-dev digest, Vol 2 #1121 - 20 msgs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cocoa-dev digest, Vol 2 #1121 - 20 msgs


  • Subject: Re: cocoa-dev digest, Vol 2 #1121 - 20 msgs
  • From: Kirk Kerekes <email@hidden>
  • Date: Sat, 17 Aug 2002 18:39:33 -0500

I agree with you.

I have found that the urge to create local variables away from a block boundary is generally a signal that some more factoring needs to be done. Often the desire to create them anywhere but at the top of a function is a solid indicator that the some new functions need to be written.



On Saturday, August 17, 2002, at 02:11 PM, email@hidden wrote:

Message: 7
Date: Sat, 17 Aug 2002 16:44:11 +0200
Subject: Re: Creating Menu Items from NSMutableArray (but now wildly
offtopic)
Cc: email@hidden
To: Andrew Pinski <email@hidden>
From: Simon Stapleton <email@hidden>

From: Andrew Pinski <email@hidden>
Subject: Re: Creating Menu Items from NSMutableArray
To: email@hidden (Kyle Moffett)
Date: Fri, 16 Aug 2002 19:23:31 -0400 (EDT)
Cc: email@hidden, email@hidden (Ryan Hale)

A basic C error. The 'int index;' needs to come with all the other
variable declarations at the beginning of the function or block.

It is not a basic C error, it is basic pre-C99 error.
You should be glad this has changed for C99.

Hmmm. The only bonus I see from the 'declare anywhere' thing is the
ability to define loop control variables in the loop statement (i.e.
`for (int i = 0;;)`) -everywhere else I've seen it used it tends to
obfuscate what variables are being used.

Stylistic thing, I guess, and probably stemming from years of C
programming

Even in C++, I tend to declare all the variables at the top of the
block. Maybe I should upgrade to COBOL ;-)

Simon
_______________________________________________
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.

  • Prev by Date: Looking for ideas about displaying unkown-type data
  • Next by Date: years:months:days:hours:minutes:seconds:sinceDate: really slow!
  • Previous by thread: Re: Looking for ideas about displaying unkown-type data
  • Next by thread: years:months:days:hours:minutes:seconds:sinceDate: really slow!
  • Index(es):
    • Date
    • Thread