Liste des Groupes | Revenir à cl c |
On 31/10/2024 12:11, fir wrote:switch is literally flawed construction - (i was even writing or at kleast thinking why, last time but sadli i literrally forgot my arguments, would need to find that notes)somethins i got such pices 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 - but the question is if to do that
Why not ...
>
switch (n)
{
case 1:
/* something */
break;
>
case 2:
/* etc ... */
>
default:
/* something else */
}
>
... ?
>
>>
do teh code has really chance to be slower without else (except some
very prmitive compilers) ??
>
not adding else makes liek code shorter.. so im not literally sure
which is better
The size of teh [sic] source code won't make any difference to the size
of the executable - so aim for readability first and foremost.
>
>
>
>
Les messages affichés proviennent d'usenet.