A hallway talk at the Alt.NET Israel Unconference got me thinking about coding standards in general, and naming conventions in particular.
I’ve seen dozens of holy wars regarding the subject of naming conventions - when a project starts, when a new team member comes along, when the team leader is replaced etc.
I used to think that a project should have a single naming convention, and everyone should follow it. Now, I’m not so sure any more. I mean, what is really so important about naming conventions? What makes a project with a unified naming convention better than a project without one?
Unity
The first argument for naming conventions is always unity. You want all your data members to look the same.
But, think of it, what is really that important about unity? What business value do you get from it? Does it cut down development time? Does it improve performance?
IMO, if one developer wants his field to be called “_identifier”, another wants “m_identifier” and the other wants “nIdentifier”, just let them! No one ever died from Hungarian notation or a “m_” prefix, I believe.
Readability
For those who still believe in Hungarian notation (or any of its siblings), readability seems to be a great argument for naming conventions.
However, Hungarian notation might have been a good argument a decade ago. Today, all IDE’s provide great intellisense, and one could determine the type of a member in a second by hovering on it.
Scope
Determining the scope of a variable (method or class) is important, but can also be easily discovered by intellisense.
Focus on What’s Important
I’m not trying to say you shouldn’t have a naming convention in your project. I’m just trying to say, don’t let it bother you so much.
Set up a naming convention at the beginning of the project, have your team members agree on it, but don’t hunt down any exception and have it fixed.
Write a unit test or get a cup of coffee instead.
Do you think naming conventions are important? Where would you draw the line?
Couldn’t agree with you more:
http://il.dotmad.net/archive/2008/07/22/good-team-developers-are-cameleons.aspx
I partially agree. You should have unity (it definately improves readability). But hunting down exceptions… enter StyleCop compiler warnings while building in this way it’s a joined effort.
Regarding Hungarian notation, I still get caugth from time to time using it (it’s a habit). The big advantage is that when using intellisence and working in a asp.net code behind page, I can type txt and all the textboxes are nicely shown together and I don’t have to remember if I have named that field comments or remarks. (so yes it saves development time)
is very awkward or if you would use uppiLoadC… bye bye self commenting code and variable names)
BUT (big but) with all the new ajax controls/custom controls the hungarian notation has become awkward!(updatepanelprogressindicator => upnlprgindLoadCustomerProgress
I try to get rid of this bad habit.
On a different note but adjacent to your point: “which brace style do you use?”
It was only after inspecting some opensource coding guidelines, I was exposed to the different styles.. OMG:
http://en.wikipedia.org/wiki/Indent_style
I use:

- K&R in javascript (consistent with most js-libraries)
- Allman in all other projects
This is over simplifying a concept. From what I understand, you are talking about coding standards at syntactical level, not at semantic level. Go ahead and read
I am sure you won’t be of same opinion ;-). Please post here If you have changed/not changed your mind after reading the above piece from Joel.