From the course: C# Best Practices for Developers

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Namespaces

Namespaces - C# Tutorial

From the course: C# Best Practices for Developers

Start my 1-month free trial

Namespaces

- [Instructor] An important part of classes are namespaces. You might have noticed that when you created a project Visual Studio created a namespace around our class. So for example, on the right here, in our solution explorer our project name was prestige.biz. And as you can see on line seven that is exactly what the namespace is called. Namespaces provide a unique address for our class and organize the application classes in a logical hierarchy. And those hierarchies can be somewhat complex and an example is the .net system a namespace. Let's take a look at lines one through five. This hierarchy, by grouping functionality, helps us be able to find what we are looking for easily. So if I were to comment out line one I no longer will have access to our console, but I can type in system to be able to get access to it. So it's a good practice though to avoid this and use namespaces just like we do on line one to minimize redundancy. And when you're not using classes that are in some…

Contents