Stupid question...

How the hell does one actually get a C# program going with VS2012? All I want to do is create one class by myself, but the best option I can find creates it all for you and wraps it in a namespace. Is it not possible to create an empty project anymore??
Idk about VS, but it is customary in C# to encapsulate all classes into namespaces, sometimes 2-3 levels deep (hence why you have things like System.Collections.Generic.List). Where C++ uses namespaces just to avoid polluting the global namespace, C# uses them to make code extremely structured.
Last edited on
I guess that's something to get used to. Couldn't find anywhere in the documentation referring to this little fact.
It's not required, it's just a convention, like it's a convention in Java that class names start with a capital letter and members start with a lower-case letter.

Personally I'm in favour of it, although I like C++'s use of namespaces too.
Are there no includes in C#? I have a couple classes right now and it all works without my main class having any sort of include/import/whatever C# uses.
C# doesn't need anything like that because of the way its symbol resolution works. If you don't want to type out a long series of nested namespaces for every class you use, though, you can put using directives at the top of your source files.
Topic archived. No new replies allowed.