Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can execute a button click method without showing the fo
Message
De
02/10/2019 09:05:28
 
 
À
02/10/2019 08:03:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01671046
Message ID:
01671326
Vues:
58
>>I also believe people who write case statements like this:
>>
>>
DO CASE
>>CASE whatever1
>>    * Code here
>>CASE whatever2
>>    * Code here
>>ENDCASE
>>
>>
>>Should be shot. The correct way to write a case statement, as everyone should know, is this:
>>
>>
DO CASE
>>    CASE whatever1
>>        * Code here
>>    CASE whatever2
>>        * Code here
>>ENDCASE
>>
>>
>>It's only natural. :-)
>
>And once again I disagree with you. The CASE keyword is at the same conceptual level as the DO CASE and ENDCASE, so I prefer for them all to line up. Similarly, I don't indent inside PROC/FUNC until I have a control structure.
>
>That said, knowing you have dyslexia, I understand why indenting in those places helps you. I'm more concerned about not getting way over on the right and I can see the structure just fine without those additional indents. These, to me, are not cases of right and wrong, just personal preference.


I agree, of course. My comment there was for humor. Although I do believe CASE statements and FUNCTIONs/PROCEDUREs should be indented. They mark off blocks of code, and indenting them serves the same general purpose as indenting within an IF..ENDIF block, or other block. It highlights visually what's related.

It is personal preference. I have evolved into this syntax / style I use over three decades now. Most people who review my code comment on my style and tell me it looks crisp and clean. Some of them comment that I'm a little anal in how far I take it, but when they learn I have dyslexia they go, "Ohhh." :-)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform