Walter Meester
HoogkarspelPays-Bas
Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
>Hi Andy,
>
>>Another programmer introduced me to using DO CASEs like your sample below.
>>To me, this code is much more readable than nested IF statements.
>>Jim does not like this style.
>
SNIP
You've got my stand right, Andy.
I'd only point out that you were recently introduced to the coding technique AND that *you* find it eminently more 'readable' that a nested IF.
I'd say that makes exactly my points:
1) It was UNnatural to you, as I contend it will be for 95%+ of programmers;
2) It is 'easier' to read than nested IFs. I say it's only "easier" if you are aware of what's going on. The problem for the rest of us is that it's still "easy" but we would be reading it incorrectly, not anticipatng that the entire construct is designed to do a whole job, CASE by CASE, never to actually execute the code under any CASE. That's just plain counter-intuitive to 95%+ of programmers.
Satisfying your distaste of nested IFs is legitimate if you are to be the only one to read/revise the code. Else, in my opinion, it is a wrong thing to do.
cheers
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement