Naming convention for process variables and CDT elements

I'm kicking off development on a new application and am thinking about the naming convention for process variables and CDT elements.
Should the convention follow reverse Hungarian notation where the type of the CDT attribute or PV is included as a suffix, eg pv!firstName_txt or should it leave out the prefix, ie pv!firstName?

I can see pros and cons for each approach and would like to here what others are doing on their projects.
...

OriginalPostID-131831

OriginalPostID-131831

  Discussion posts and replies are publicly visible

Parents
  • This will be personal preference (or local best practice), but I have found that including the type in a suffix will assist other developers in supporting or enhancing the application down the road. I also tend to group variables with a prefix for my own reference, in models with 400+ variables they are easier to locate even just during initial configuration/design with a setup something like:

    pv!empName_txt
    pv!empHiredOn_date
    pv!empSupervisor_user
    pv!formDataField1_txt
    pv!formDataField2_date
    pv!sysProcessCompleted_datetime
    pv!sysNavigationDecision_txt

    Also note that in your modeler (at least on 7.3) variables that start with upper case will be sorted first, with all lower case variables sorted separately below. Because of that I try to keep everything in camel case (starting with lower).

    Just some ideas. Good luck!
Reply
  • This will be personal preference (or local best practice), but I have found that including the type in a suffix will assist other developers in supporting or enhancing the application down the road. I also tend to group variables with a prefix for my own reference, in models with 400+ variables they are easier to locate even just during initial configuration/design with a setup something like:

    pv!empName_txt
    pv!empHiredOn_date
    pv!empSupervisor_user
    pv!formDataField1_txt
    pv!formDataField2_date
    pv!sysProcessCompleted_datetime
    pv!sysNavigationDecision_txt

    Also note that in your modeler (at least on 7.3) variables that start with upper case will be sorted first, with all lower case variables sorted separately below. Because of that I try to keep everything in camel case (starting with lower).

    Just some ideas. Good luck!
Children
No Data