Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
One exit per procedure/function/codeblock to what purpos
Message
De
08/10/2003 20:35:23
 
 
À
08/10/2003 19:43:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00835552
Message ID:
00836594
Vues:
14
>>>- Final trick question: do you support the use of LOOP in DO...ENDDO?
>>
>>Yes, I use LOOP and EXIT frequently in DO WHILE, SCAN, FOR, etc. They wouldn't be in the language if they weren't meant to be used. For the same reason that a "GO TO" (code line) is NOT in the language.
>>I've never used RETURN TO..., which I guess comes close to a GO TO.
>
>I've even used goto in a C program (once) to get to the bottom (single exit point) out of a complex function from somewhere in the middle of some hairy logic. Kept me from having to have all kinds of conditional flags in the logic muddying things in order to get to the exit code gracefully.

Hi Fred,

I feel, in languages that support GO TO, that the "one exit point" is pretty-much a mandatory rule required to absolutely prevent the use of GO TO to another routine.
That at least restricts the use of GO TO to the single routine.

cheers
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform