delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/31/13:45:34

From: me AT here DOT com
Newsgroups: comp.os.msdos.djgpp,comp.os.msdos.programmer
Subject: Re: Iteration vs. Recursion...
Date: 31 Jul 1999 17:09:44 GMT
Organization: Plug 'n' Pray!
Lines: 22
Message-ID: <7nvako$sh1$2@schbbs.mot.com>
References: <7n7s1h$ms6$1 AT autumn DOT news DOT rcn DOT net> <37978194 DOT 17661031 AT news DOT cso DOT uiuc DOT edu> <01bed879$332ecc60$9154f6cc AT symbology DOT symbology DOT com> <37a17fdc DOT 2230829 AT news DOT aardvark DOT apana DOT org DOT au>
NNTP-Posting-Host: css08u.seattle.css.mot.com
User-Agent: tin/pre-1.4-19990216 ("Styrofoam") (UNIX) (SunOS/5.6 (sun4u))
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In comp.os.msdos.programmer Peter "Shaggy" Haywood <phaywood AT aardvark DOT apana DOT org DOT au DOT stop DOT spam> wrote:
> Groovy hepcat Dave Dutcher was jivin' on 27 Jul 1999 21:44:32 GMT in
> comp.os.msdos.programmer.
> Re: Iteration vs. Recursion...'s a cool scene! Dig it!

>>But I couldn't help noticing that a lot of people suggested switch
>>statements.  I wonder if people suggested a switch statement because the
>>orignal poster was looking to increase his speed, or did they suggest it
>>because they think switch statements are more readable?  I am wondering
>>because, from what I have heard, switch statements are no faster than a
>>whole bunch of if statements.

>   That's not always true. A switch can be more efficient than a series
> of if statements, but that all depends on the compiler.
>   But I'd say the suggestion to use switch instead of if was more for
> readability than anithing else.

Personally, I usually use if / else for up to 3 conditions, 
and switch for 4 or more, and that's mainly because of 
readability.


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019