Tags: | Categories: development Posted by pieterg on 2/10/2010 3:28 PM | Comments (60)

There are so many times that I see little gremlins hopping around in code and this is just me venting about it.

Naming Conventions

There have been numerous posts, articles and tweets about naming conventions and this is just my rant about this very topic.

Why use naming conventions?

The answer is pretty simple, chaos will ensue and little gremlins will run around your code, because no developer will be able to quickly glance at the code and understand what is happening because names like “Rdr” and “obj” (which, by the way is my favourite) just doesn’t describe what the variable is supposed to be used for. Furthermore, if you have no standard, you don’t know whether or not the variable is a parameter, member variable or property of the class.

Do you see what I’m getting at?

Naming convention reduces the time for a developer to look, understand and use the code. Naming conventions on MSDN

Consider the following lines of code

public class cPerson { private int iAge; private string sName; }
public class Person { private int age; private string name; }

You should be able to infer the type from the name of a member of a class. Age is an integer, it’s definitely not a double, nor is it a string.

You should not need to prepend the member with the first letter of the type. The type should be inferred. Instance naming This is where I just go absolutely mental. Take a look at the following code. Mixed up in a 400 line method where you have to first figure out what type the variable is because its name doesn’t describe it completely.

SqlConnection con = new SqlConnection();
SqlConnection northwindConnection = new SqlConnection();

Conclusion

I believe that it’s so important that as a developer, you should standardize your naming conventions as long as it’s readable, understandable and logical.

Comments

Rim
Rim Netherlands on 1/2/2010 9:10 PM
As promised Smile

“Real programmers don’t use naming conventions. If it was hard to write, it should be hard to understand.”
pieterg
pieterg South Africa on 1/3/2010 5:58 AM Ummmm....
mothers day crafts
mothers day crafts United States on 1/15/2010 1:19 AM Hello,I love reading through your blog, I wanted to leave a little comment to support you and wish you a good continuation. Wishing you the best of luck for all your blogging efforts.
no loss robot
no loss robot United States on 1/16/2010 4:47 AM Nice information, many thanks to the author. It is incomprehensible to me now, but in general, the usefulness and significance is overwhelming. Thanks again and good luck!
Cyrstal Stittsworth
Cyrstal Stittsworth Australia on 1/17/2010 8:32 PM Good morning, You write some very informative blogs. I always check back here often to see if you have updated. I saw this very same blog at <a href="http://www.article-pie.com/">http://www.article-pie.com/</a>  keep on blogging!
Bryan Peretti
Bryan Peretti Australia on 1/18/2010 3:58 AM Good afternoon, You write some very interesting blogs. I always check back here often to see if you have updated.
Winfield NJ Plumbing
Winfield NJ Plumbing United States on 1/24/2010 10:25 PM I have recently started using the blogengine.net and I having some problems here? in your blog you stated that we need to enable write permissions on the App_Data folder...unfortunately I don't understand how to enable it.
the pacific episode 1
the pacific episode 1 United States on 1/30/2010 12:08 PM Ola.Hello.Sorry if my english language isn't nice.however i simply want to say that i like this page very much.Say thank you!
mercedes alloy wheels
mercedes alloy wheels United States on 2/1/2010 2:14 PM Keep 'em coming... you all do such a great job at such Concepts... can't tell you how much I, for one appreciate all you do!
digital cameras
digital cameras United States on 2/6/2010 9:04 AM I completely agree with the above comment, the internet is with a doubt growing into the most important medium of communication across the globe and its due to sites like this that ideas are spreading so quickly.
Free iPhone 3GS
Free iPhone 3GS United Kingdom on 2/7/2010 7:26 PM I'll gear this review to 2 types of people: current Zune owners who are considering an upgrade, and people trying to decide between a Zune and an iPod. (There are other players worth considering out there, like the Sony Walkman X, but I hope this gives you enough info to make an informed decision of the Zune vs players other than the iPod line as well.)
tips to get pregnant
tips to get pregnant United Kingdom on 2/8/2010 9:55 AM Easily, the post is actually the best on this deserving topic. I fit in with your conclusions and will eagerly look forward to your upcoming updates. Just saying thanks will not just be sufficient, for the extraordinary lucidity in your writing.
affordable health care
affordable health care United States on 2/8/2010 12:44 PM This is a really good read for me, Must admit that you are one of the best bloggers I ever saw.Thanks for posting this informative article.
how can i get pregnant
how can i get pregnant United Kingdom on 2/9/2010 12:26 AM Loving this the post as it is in reality the sweetest on this valuable topic. I agree with your conclusions and will thirstily look forward to your upcoming updates. Saying thanks will not just be enough, for the wonderful clarity in your writing. I will at once grab your rss feed to stay informed of any updates.
purchase viagra condom
purchase viagra condom United Kingdom on 2/9/2010 8:20 AM We observe, for instance, that a lot of people now engage more readily in walking as opposed to driving and the news media regularly inundate us with news of pay cuts and cut down of workforces by companies all across the country.
projektowanie stron internetowych radom
projektowanie stron internetowych radom Poland on 2/9/2010 7:40 PM Great article I've just added to my bookmark list.
Sportsbet Free Bet Code
Sportsbet Free Bet Code Australia on 2/10/2010 2:32 AM Found this site from a search in Yahoo when looking for sportsbet codes Some great stuff here!
reverse phone directory
reverse phone directory United States on 2/11/2010 6:56 AM Dude.. I am not much into reading, but somehow I got to read lots of articles on your blog. Its amazing how interesting it is for me to visit you very often.
Used Computers
Used Computers Canada on 2/11/2010 7:09 AM Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon... Regards… http://www.pctechoutlet.com
John Kirk
John Kirk United States on 2/11/2010 9:26 AM I like the blog, but could not find how to subscribe to receive the updates by email. Can you please let me know?
Kelsi Ceaser
Kelsi Ceaser United States on 2/11/2010 5:39 PM Hi webmaster - This is by far the best looking site I’ve seen. It was completely easy to navigate and it was easy to look for the information I needed. Fantastic layout and great content! Every site should have that. Awesome job
IRA calculator
IRA calculator Germany on 2/11/2010 5:44 PM Be sure not to limit yourself. Many writers limit themselves to what they think they are able to do. Keep in mind that you can go as far as your mind will let you.
Property Bulgaria
Property Bulgaria United States on 2/12/2010 2:59 PM I like the blog, but could not find how to subscribe to receive the updates by email.
Free iPhone
Free iPhone United Kingdom on 2/13/2010 2:32 AM Cheers for the great info m8
Legalsounds
Legalsounds United Kingdom on 2/14/2010 11:12 AM I know this is really boring and you are skipping to the next comment, but I just wanted to throw you a big thanks - you cleared up some things for me!
privat Krankenversicherung
privat Krankenversicherung Austria on 2/14/2010 11:58 AM I did not anticipate this on a Wednesday. This can be a great story. Many thanks!
Andres Bison
Andres Bison on 2/14/2010 5:21 PM Hello - I must say, I’m impressed with your site. I had no trouble navigating through all the tabs and information was very easy to access. I found what I wanted in no time at all. Pretty awesome. Would appreciate it if you add forums or something, it would be a perfect way for your clients to interact. Great job
Dancing Bear
Dancing Bear United Kingdom on 2/15/2010 8:45 AM Hello, Will you be posting a follow-up write-up? The partner and myself have used up some time looking over your blog and interestingly you highlighted something we were discussing only the other month with our dentist. We very often hear ourselves quarrelling on the littlest of points, isn't it foolish? Regardless we wish everyone all the best from  the States.
mini e-cig
mini e-cig United States on 2/16/2010 4:56 AM It becomes obvious that they're is a lot to experience around this. I think u have established a bunch of good thoughts in ur article.
prefabrykaty budowlane
prefabrykaty budowlane Poland on 2/17/2010 3:44 AM Great article I've just added to my bookmark list.
reverse phone lookup
reverse phone lookup United States on 2/18/2010 8:05 PM nice info you have tired to explore against the world and I appreciate that
specialty coffee
specialty coffee United States on 2/19/2010 10:04 PM Good post, nice job. It Couldn't be published any greater. Reading this post reminds me of my previous co worker! He constantly kept talking about this. I will forward this article to him. Pretty sure he will have a delightful read. Thanks for posting!
guitar lessons for beginners
guitar lessons for beginners United States on 2/20/2010 1:07 AM can anyone tell me how to get those little avatars to show up in my comments section? thanks!
livejasmin cams
livejasmin cams United States on 2/20/2010 2:44 PM This is a really good read for me, Must admit that you are one of the best bloggers I ever saw.Thanks for posting this informative article.
learn to play the guitar
learn to play the guitar United States on 2/21/2010 9:11 PM i am subscribing. thanks
http://web.archive.org/web/*/http://delicious.com/emsplanet
http://web.archive.org/web/*/http://delicious.com/emsplanet United States on 2/26/2010 5:58 AM Hi I'm trying to create a rs feed from your website to another site. How can we go about this ???
wow leveling guide
wow leveling guide United States on 3/2/2010 3:40 AM Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon.
coffee maker
coffee maker United States on 3/5/2010 5:28 PM Thanks a great deal! I truly enjoyed reading this. It makes me want to create my own blog. I do not know what subject though? I am a grounds keeper but can't think most people wanting to read about that! Perhaps I'm wrong. Any ideas?
Reverse Phone Lookup
Reverse Phone Lookup United States on 3/6/2010 5:18 AM Nice information.  Its usefulness and significance is overwhelming. Wonderful post
Free Nintendo DSi
Free Nintendo DSi United States on 3/7/2010 5:12 PM Interesting reading, thanks
Frankie Goodling
Frankie Goodling United States on 3/8/2010 1:14 PM It does seem that everybody is into this kind of stuff lately. Don’t really understand it though, but thanks for trying to explain it. Appreciate you shedding light into this matter. Keep it up
Melody Migdal
Melody Migdal United States on 3/9/2010 5:40 AM It does seem that everybody is into this kind of stuff lately. Don’t really understand it though, but thanks for trying to explain it. Appreciate you shedding light into this matter. Keep it up
fat loss 4 idiots review
fat loss 4 idiots review United States on 3/12/2010 3:45 PM i like the layout of your blog. hope you don't mind if i do something similar with mine.
Colon Cleanse
Colon Cleanse United States on 3/12/2010 8:35 PM I read you post... this is informative and helpful..
I like to know more about affiliated marketing.. Thanks for sharing your knowledge about it.
ss monte carlo
ss monte carlo United States on 3/19/2010 9:52 AM This is such a wonderful useful resource that you will be delivering and you provide it away for free of charge. I really enjoy seeing web sites that comprehend the worth of giving a excellent resource for absolutely free.
DVD Rental UK
DVD Rental UK United States on 3/20/2010 3:36 PM Cheers for this explanatory entry. I am constantly searching for information on particular subjects and it's never far away on the net. I'll be returning soon.
LoveFilm Trial
LoveFilm Trial United States on 3/20/2010 3:36 PM Good post, adding it to my blog now, thanks
fitflops
fitflops United States on 3/22/2010 9:07 AM I really love this particular post very much. This is incredibly helpful and also extremely well done.Thanks a lot for this.However I invite you to come on my webpage too if you want.The summertime is on its way and we now have the most efficient fitflops online shop of the cyberspace.We are specialized in fitflops oasis and very reliable. Congratulations again for your website.
baby furniture
baby furniture United States on 3/23/2010 8:17 AM Loving this the post as it is in reality the sweetest on this valuable topic. I agree with your conclusions and will thirstily look forward to your upcoming updates. Saying thanks will not just be enough, for the wonderful clarity in your writing. I will at once grab your rss feed to stay informed of any updates.
fitflop
fitflop United States on 3/23/2010 3:11 PM I really like this website a lot. It is very helpful and also extremely well done.Thanks a lot for it.And anyway I invite you to check my internet site too if you want.Summertime is coming and we get the very best fitflop online shop of the cyberspace.We are experts in fitflops walkstar and really reliable. Best wishes once again for your blog.
baby furniture
baby furniture United States on 3/25/2010 5:52 PM Easily, the post is actually the best on this deserving topic. I fit in with your conclusions and will eagerly look forward to your upcoming updates. Just saying thanks will not just be sufficient, for the extraordinary lucidity in your writing.
Rapidshare
Rapidshare United States on 3/28/2010 3:39 AM I\'m happy I found this blog, I couldnt discover any info on this subject matter prior to. I also run a site and if you want to ever serious in a little bit of guest writing for me if possible feel free to let me know, i\'m always look for people to check out my site. Please stop by and leave a comment sometime!
Sabrina Zari
Sabrina Zari United States on 3/28/2010 6:23 PM for a few of my sites but looking to change one of them over to a platform similar to yours as a trial run. Anything in particular you would recommend about it?
Shirley Vandyck
Shirley Vandyck United States on 3/29/2010 11:53 AM I am not really sure if best practices have emerged around things like that, but I am sure that your great job is clearly identified. I was wondering if you offer any subscription to your RSS feeds as I would be very interested and can?t find any link to subscribe here.
Bennett Gentsy
Bennett Gentsy United States on 3/30/2010 6:03 PM This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here keep up the good work.
Government Grants For Homes
Government Grants For Homes United States on 4/2/2010 9:44 PM This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here keep up the good work.
Lakeisha Steuart
Lakeisha Steuart United States on 4/5/2010 2:17 AM I was very pleased to find this site.I wanted to thank you for this great read I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you post.
locksmiths
locksmiths Yemen on 4/7/2010 2:15 PM development development developmentYou made some good points there about development . I did a search on the topic and found most people will will agree with your blog.
Arlen Mccutcheon
Arlen Mccutcheon Estonia on 4/9/2010 11:22 PM HO YA development development developmentI have been surfingonline just above three hrs today, until now I by no means found any interesting article similar to yours about development It really is pretty worth enough for me. For my part, if all web owners and bloggers made good content as you did, the web will likely be much more practical than ever before.
pingback
424.computeronlinebingo.com on 4/20/2010 9:05 AM Pingback from 424.computeronlinebingo.com

9mm Beretta Parts Firing Pin, Chevy Beretta Car Parts

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading