Tuesday, November 13, 2007

Hungarian Notation

When ever I am coding or say, ever since I am into Windows Programming there is one thing that is always back of my mind

“Follow the Hungarian Notation”

I being a Java Programmer never followed Hungarian Notation but yes, tried my best to giving some Sensible names to my variables

Let me have a look at the my

Variable Naming Life Cycle

Role :Student

Variable Names : a, x, y, z

Reason : To be the first one to submit the online assignment

Result: Full marks & Teachers Impressed

Role : Java Programmer

Variable Names : var, count, vectSize, str, con, rs

Reason : I used to Understand that much better , saved time and my Application running on web

Result: Warnings but Happy ( completed my task before time )

Role: Windows Programmer

Variable Names : all sorts of veered names

Reason : I was confused others too

Result: Penalties…………….and Sweet Warnings before I start a new module

I remember Hungarian Notation being a chapter in my C Programming but never took it seriously.
started taking it seriously after my training session on Hungarian Notation.

Bookish Definition:

Naming Convention in which the name of a variable indicates its Datatype.

Self Definition:

Reminding a forgetful programmer that he cannot store a float value in an integer declared variable.

Was invented by Charles Simonyi Chief Architect at Microsoft.

In spite of its Advantages like:

  • The variable type can be seen from its name
  • Easy to remember…………..blablabla


For me :

  • It has brought in more Discipline in my Coding Styles
  • Makes my Program more Readable to Others who follow it
  • I walk through my code not to check its functionality but to see if I have followed the Hungarian Notation.

No comments: