Sujet : Re: else ladders practice
De : anton.txt (at) *nospam* g{oogle}mail.com (Anton Shepelev)
Groupes : comp.lang.cDate : 31. Oct 2024, 14:15:45
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20241031161545.aed6541ce6c728923a46e9df@g{oogle}mail.com>
References : 1
User-Agent : Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
fir:
somethins i got such pies of code like
>
if(n==1) {/*something/}
if(n==2) {/*something/}
if(n==3) {/*something/}
if(n==4) {/*something/}
if(n==5) {/*something/}
>
technically i would need to add elses
Why?
but the question is if to do that o teh code has really
chance to be slower without else (except some very
prmitive compilers) ?? ot adding else makes liek code
shorter.. so im not literally sure which is better
I am all for code literalism, and want it to emphasize the
most natural method of execution. Therefore, I usually
append `return' or `goto' to each then-block in an tabular
if-sequence as above. I believe the perormance will depend
on the compiler.
-- () ascii ribbon campaign -- against html e-mail/\ www.asciiribbon.org -- against proprietary attachments