Posted by: Harold Ennulat | March 3, 2014

TheCaseForCamelCase – Or is it PascalCase?

CamelCaseHere are some links that help make the case (or for many, help reinforce the case) for CamelCase notation in the naming of variables in any kind of programming including PLC and HMI development work.

http://en.wikipedia.org/wiki/CamelCase has interesting comments about the readability of Camel Case which apparently is a common criticism.

http://en.wikipedia.org/wiki/Naming_convention_(programming).  A general description of variable naming conventions.

http://msdn.microsoft.com/en-us/library/x2dbyw72(v=vs.71).aspx suggests that CamelCase is more accurately called PascalCase since technically CamelCase should really be camelCase to be camel case….

http://cplus.about.com/od/learnc/ss/csharpclasses_5.htm  cites the Microsoft Design Guide as also distinguishing the use of camelCase from PascalCase.

http://cplus.about.com/gi/o.htm?zi=1/XJ&zTi=1&sdn=cplus&cdn=compute&tm=69&f=00&su=p284.13.342.ip_p504.6.342.ip_&tt=29&bt=5&bts=5&zu=http%3A//msdn2.microsoft.com/en-us/library/czefa0ke%28VS.71%29.aspx.  Microsoft .Net Design Guidelines suggests usage for both camelCase and PascalCase naming of variables, and structures.

For this author, I’m not as concerned about what it is called, but that this variable structure be considered as a best practice when naming variables in PLC or HMI applications.  However I learned that what I prefer to use is actually called PascalCase.  In the circles I’ve traveled we’ve called it CamelCase for so long that I’m going to have to adjust my vocabulary, even though some of the sources cited above don’t necessarily make this distinction.  But then who can argue with Microsoft?

In a future post I’d like to discuss how to structure the naming of variables in a hierarchal format in the form of AreaSectionEquipmentFunction when naming variables and also review the benefits of this method in rapid code generation.

________________________________________________________________________

 Created 3/2/2014 4:00 pm | Published 3/3/2014 5:00 am

Advertisement

Responses

  1. See https://hennulat.wordpress.com/2014/04/21/plc-hmi-tag-naming-tips/ for examples in the use of Pascal Case and the suggested Hierarchical format.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Categories

%d bloggers like this: