Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
2.00/5 (2 votes)
See more:
What can you do to make sure you don’t have any type name collisions in your code?
Posted
Updated 27-Oct-10 2:51am
v2

Don't call everything the same name.
 
Share this answer
 
I think, one of the main reason why we have namespaces is this only!

Further, it's more of coding standards and practices that one follow.
 
Share this answer
 
Just two things:


  1. Use descriptive names: this way it's difficult that two different things has exactly the same name.
  2. Use namespaces to group things basing on their subject. As an example think about the System.Timers.Timer and System.Threading.Timer classes: the two classes has the same name, but are defined on two different namespaces, as they do similar things but in different contexts.
 
Share this answer
 
Use standard naming conventions and more descriptive terms.
Also, in the code comment what each is for, trust me after 3 months you will not remember!
 
Share this answer
 
Always move for Unique Name and if you do you will never get collision in you program.
 
Share this answer
 
Namespace is the thing which introduced because of name collision.

And if you want to make sure that it doesn't collided then debugger is there to make a optimization of your program. :laugh:
 
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