Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Always better to ...?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00338054
Message ID:
00338701
Vues:
21
Al,

>If you look at VFP Help, "FOR lExpression" is shown as a required clause of the LOCATE command, although experience has clearly shown it isn't required. A command parser working strictly to the VFP documentation would throw an error on that line.
>
>Besides looking "incomplete", a plain LOCATE command gives no inherent indication of what it actually does. Someone not familiar with how the command actually works might assume that:
>
>- it goes to the current record
>- it goes to EOF(), because it clearly can't find something that isn't specified

I'll agree here, especially if the LOCATE statement is abbreviated. I ran into this recently and it did give me pause as to what was going on.

>That meets my definition of cryptic.

>As for comments, no-one's holding a gun to your head. Personally, I feel it's impossible to have too many comments in one's code.

It's true that no one's holding a gun here, but I'll disagree. Commenting the obvious is not only unnecessary, but annoying and can actually harm the overall readability of the code. Further, if someone doesn't understand that a statement like: IF USED() does without the benefit of a comment, they've got no business in the code in first place. Writing small, highly functionally cohesive modules, also reduces the necessity for lengthy comments, since what the module does should be easily discerned from its name alone. In complex situations, I actually write the comments before I write a line of code. This gives me a "blueprint" as to what the necessary steps are to accomplish the task at hand.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform