September 22, 2009

Why my variable and object names in my code are so long

Filed under: Development — J. Abram barneck @ 4:41 am


Reason 1 – One of the main reasons that variable names have been shortened in the past are because you have to type them and the longer they are the longer they take to type. However, with today’s Integrated Development Environments (IDEs) you only have to type a few characters and then hit tab or enter and it finishes the variables for you. So this reason for short variable names has become a non-factor.

Reason 2 – The longer the variable name, the better documented your code is. Lets face it, there are those that demand documentation and those that argue that code should be so well written it doesn’t need documentation. So if I have a variable that represents the time it takes to drive to work, I will go ahead and make the variable name, theTimeItTakesToDriveToWork.


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

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 )

Google+ photo

You are commenting using your Google+ 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

Blog at WordPress.com.

%d bloggers like this: