posts - 280, comments - 318, trackbacks - 0

My Links

News

View Steve Michelotti's profile on LinkedIn

Twitter












Tag Cloud

Archives

Post Categories

Blend Bloggers

Bloggers that I follow

Books

F# Bloggers

F# Communities

F# Online Books

Fonts

HTML CSS ASP

Machine Learning

My Links

My Local UserGroups

My Online Presence

MY SA Links

Online Seminars

SA Software Companies

Web Design

Casing when coding

 

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

Print | posted on Wednesday, September 07, 2011 6:25 PM | Filed Under [ Misc ]

Feedback

Gravatar

# re: Casing when coding

Take on the camel casing which was very popular in the Pascal days is Hungarian notation: http://en.wikipedia.org/wiki/Hungarian_notation

9/8/2011 10:22 AM | Robert MacLean
Gravatar

# re: Casing when coding

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...
9/9/2011 8:19 AM | Mark Pearl
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: