Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Coding Standards
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00115272
Message ID:
00115483
Vues:
16
Naming conventions additions

Object properties also follow the same rule you specified for fields (i.e no scoping)

array's have an a instead of type (as in laMyArray)

coding :
I use a prameter object for inter-object parameter passing

if there is a good chance that sub-classes will need to add code to a method
I add a PreMethod method that is called before the method is executed
as in :
PROCEDURE SomeMethod
    LOCAL llContinue
    llContinue=this.PreSomeMethod()
    if llContinue
       * code
    endif
ENDPROC
this way the subclass can do some more process and also override the default action

like George I try to have a single exit point for methods
I always put parenthesis for method and funtion calls

I try to have properties that affect the object state protected (or HIDDEN) and handle them via SET and GET methods (in VFP6 I am moving this to ACCESS and ASSIGN methods)

I use double tabs for CASE statements e.g.
DO CASE
    CASE something=somethingelse
             Action
    CASE somethingelse
             someother Action
    OTHERWISE
             whatever
ENDCASE
conventions for commets
*{ date  developer initials  comment
    for blocks of changes
*}

* TODO - DATE  message desribing things need to be done

*!* temporary commented code (the VFP default for commenting out blocks)

* for explanations
I also add an ABOUT method where the purpose, public API for the object, last revision and author are described

I try to have a "header" comment for methods (but not always do) for each method as well which describes purpose, author, latest revision,paremeters and outputs


there are probably more, but these are the ones that comesto mind now

Arnon
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform