Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Sorry For this question but i am very confused..So please suggest

I am using strName for string variable as naming convention.When i googled it in one site it says avoid strName and use name directly.So please suggest me which is good practice..


Thanks
Posted
Comments
[no name] 5-Sep-13 5:58am    
The "good practice" is pretty much what you decide to do as far as naming goes. If you want to use "strName" then use that. Others with use something else. They say not to use "str" because it's a hold over from the Hungarian notation days and is pretty much an obsoleted practice. But you do whatever makes you happy.
maheshnakka 5-Sep-13 6:05am    
Thanks @ThePhantomUpvoter

There are always different naming conventions.
It depends on the opinion of the customer you are working for. Their naming conventions are defined in their style guide.
This is how I know it.

If you want to stick to the general naming conventions by microsoft you should have a look at this article: http://msdn.microsoft.com/en-us/library/ms229045.aspx[^]

And also this one: http://msdn.microsoft.com/en-us/library/xzf533w0(v=vs.71).aspx[^]

Hope this helps :)
 
Share this answer
 
Comments
maheshnakka 5-Sep-13 6:06am    
Thanks all now i cleared my confusion
This article also gives you the consistent naming pattern.

http://www.akadia.com/services/naming_conventions.html[^]
 
Share this answer
 
The most important thing is being consistent.
There are a lot of naming conventions, but as long as you are consistent most customers will be happy.
 
Share this answer
 
You can refer to the following link about naming conventions in c# :

http://msdn.microsoft.com/en-us/library/vstudio/ms229045(v=vs.100).aspx[^]

A good practice is to follow the naming conventions used in the framework you are using (for example, method names in Java begin with a lower-case letter, but with an upper-case one in .NET related languages.
 
Share this answer
 
Or you may even work for a company with no human way to impose/adopt one coding style/guide, in that case just stick to chaos and do it the way it best fits your needs to understand the code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900