Help Analyzing the Visual Studio Console Defaults

Default Console Application:

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication3 { class Program { static void Main(string[] args) { } } } 

using:

  • Is there any reason you wouldn't want to call System every time?
  • Why are these four specific classes called from System on a new application?
  • Are System.Collections.Generic and System.Threading.Tasks using nested classes (i.e. System.Class.SubClass)?

namespace:

  • C# compiles without using namespace; is there any reason to include it every time?
  • What is the purpose of using multiple namespaces in a single file?
  • What is the purpose of using nested namespaces over classes?

class:

  • If I'm using Main() in multiple classes, does the compiler just start with the first one it sees?
  • Is there any reason to include "string[] args" if I don't intend to accept arguments?

by 6f00ff via /r/csharp

Leave a Reply