Browse by Tags

Tagged Content List
  • Blog Post: Do not name a class the same as its namespace, Part Four

    (This is part four of a four part series; part three is here .) Part Four: Making the problem worse I said earlier that the fundamental reason for namespaces in the first place was organization of types into a hierarchy, not separation of two things with similar names. But suppose you are putting something...
  • Blog Post: Do not name a class the same as its namespace, Part Three

    (This is part three of a four part series; part two is here , part four is here .) Part Three: Bad hierarchical design The reason we humans invented hierarchies in the first place is to organize a complicated body of stuff such that there’s a well-defined place for everything. Any time you see a hierarchy...
  • Blog Post: Do not name a class the same as its namespace, Part Two

    (This is part two of a four part series; part one is here , part three is here .) Part Two: Machine-generated code: You write namespace Foo { public sealed class Foo { public string Blah(int x) { … } } } You take this code and run a third-party “decorator” tool over it that makes your class into a more...
  • Blog Post: Do not name a class the same as its namespace, Part One

    (This is part one of a four part series; part two is here .) The Framework Design Guidelines say in section 3.4 “do not use the same name for a namespace and a type in that namespace”. (*) That is: namespace MyContainers.List { public class List { … } } Why is this badness? Oh, let me count the ways...
  • Blog Post: Inside or Outside?

    Here's a question I was asked recently which I got wrong. This is why I always encourage Microsofties to ask the entire C#/VB/whatever-interest-group their question, rather than directing it to me specifically. The question was which is "better"? (The following code snippets are not nested inside...
Page 1 of 1 (5 items)