Geeks With Blogs
Mark Pearl

 

One of the first developer jobs I had was programming in VB6 for a small business down the road. Up to that point I had been casually coding at school but this was my first exposure to “professional” development. To get the job I had to do a weeks worth of work and then get it reviewed by the boss. I thought I did a pretty good job until I got his review back and he criticized everything – in particular he ripped apart my naming conventions (or lack of them).

In memory of this event I thought I would post briefly on naming conventions / terminology. We have come a long way since the vb6 days.

Pascal Case – if you ever hear this it means that when forming a name of something, if we do it in Pascal Case we capitalize the first character of each “word”. Keeping in mind that a method name could be formed by many word. The following are examples…

  • MethodName
  • FunctionThatReturnsAValue
  • MyNameIsMark

Camel Case – think of this as looking like a camel… it starts off small and then has bumps in it. The convention is to capitalize the first character of each word except the first word. The following are examples

  • methodName
  • functionThatReturnsAValue
  • myNameIsMark

Screaming CAPS – a favourite of mine in the vb6 days of constants. Everything goes in Upper Case usually with underscores to identify different words. An example of this would be

  • METHOD_NAME
  • FUNCTION_THAT_RETURNS_A_VALUE
  • MY_NAME_IS_MARK
Posted on Wednesday, September 7, 2011 6:25 PM Misc | Back to top


Comments on this post: Casing when coding

# re: Casing when coding
Requesting Gravatar...
Take on the camel casing which was very popular in the Pascal days is Hungarian notation: http://en.wikipedia.org/wiki/Hungarian_notation

Left by Robert MacLean on Sep 08, 2011 10:22 AM

# re: Casing when coding
Requesting Gravatar...
Hungarian notation!

ahaa... I always wondered what what I was doing that was called...

those days of intCount and strName... at that time I thought it was absolutely the best naming convention... now I am so grateful I moved past that...
Left by Mark Pearl on Sep 09, 2011 8:19 AM

Your comment:
 (will show your gravatar)


Copyright © MarkPearl | Powered by: GeeksWithBlogs.net