• 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: Silly question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Silly question


  • Subject: Re: Silly question
  • From: Andrew Pinski <email@hidden>
  • Date: Fri, 21 Dec 2001 09:20:58 -0500

On Friday, December 21, 2001, at 03:00 , John C. Randolph wrote:

On Thursday, December 20, 2001, at 11:23 PM, Ben Hines wrote:

At 5:58 PM -0500 12/20/01, Lance Bland wrote:
On Thursday, December 20, 2001, at 05:15 PM, John C. Randolph wrote:

However, it is considered a bad practice to have multiple
returns in a
single function or method.

I disagree with you on this. What I tend to do is something like:

I agree with John. My favorite is this:

Most CS professors will tell you not to use multiple returns.

Most CS professors will also tell you to implement a factorial
function recursively ;-)

Most other ones will tell you to use a for loop. :(
Just use a power.


As Ondra said, if your function can't fit on one screenful of
text, it's too long.

I concur, but that's a separate issue from multiple returns.

-jcr

I almost had a psychic girlfriend, but she left me before we
met. -- Steven Wright


References: 
 >Re: Silly question (From: "John C. Randolph" <email@hidden>)

  • Prev by Date: Re: row bg color in NSOutlineView
  • Next by Date: Re: Silly question
  • Previous by thread: Re: Silly question
  • Next by thread: Re: Silly question
  • Index(es):
    • Date
    • Thread