Are type and scope prefixes worthwhile naming conventions?

Recently starting my first job as a software developer, I was a little thrown to be told that I did not have to follow any naming conventions in my code. Code written by groups working on other, larger projects followed naming conventions, but since I was brought in to write a new, stand-alone, application, the feeling was that it did not especially matter. It was the last of my worries, so I just took that existing convention and ran with it.

int nTickCount  
bool bConnected  
object[] m_aItems  
fSum += fWeight * fValue  
class cManager  
enum etSystemStates  
etSystemStates eState  

But is it actually worthwhile? I find it hard to judge the net effect that following this kind of naming convention has on comprehension and detection of errors, but, visually, it just looks kind of ugly. Plus, having every class and file in the project called cSomething seems pretty asinine.

I’m not under the illusion that it’s a remotely big deal when compared to things that make an obvious difference, like the algorithms and architectures that you employ. But any convention that affects every line of code that I write seems worth getting right.

What do you find the most elegant and effective naming convention, if one need be used at all? Does it denote type and/or scope?

About astaga

Check Also

How can I stop the Music app from launching when headphone is plugged in?

I have a Moto Droid, running Android 2.2 (Froyo), although this behavior also existed on …

Leave a Reply

Your email address will not be published.

Recent Comments

No comments to show.