Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • "You should change the name of the class" --- namespaces were invented to not rename a class as soon as you have a collision with someone else's class name Commented Dec 11, 2013 at 21:55
  • 1
    @zerkms, but in this particular case, I think the OP should change the name of class, I would never like any of my class name to be same as something provided by .Net framework. IMHO. Commented Dec 11, 2013 at 22:00
  • @zerkms While that's true, it's still generally a good idea to avoid using names of types in the system namespace, because odds are high users of your class will have a using for that namespace, thus causing a name collision. When the colliding type is in a namespace unlikely to be used in conjunction with yours, it's not an issue. Commented Dec 11, 2013 at 22:01
  • @Servy: it's a good idea to give the semantically meaningful names. If there are collisions - you can always give a different alias with using (or use FQN) Commented Dec 11, 2013 at 22:02
  • @zerkms - on other hand explicitly creating collisions with well known system classes is questionable practice from my point of view. Indeed it is entertaining to see someone hit this issue... even more fun would be to define Random.Next to return 4 but it may be too cruel. Commented Dec 11, 2013 at 22:02