What is the point of having different classes on a namespace?

So I am new to csharp and hard programming in general (I have a background in Excel VBA and SQL) and I recently designed my first program to process CSVs. After writing an 800 line single class with 5 methods to perform the task, I quickly realized it would be much easier to deal with the program if I broke my methods up into several namespaces using one namespace for my main function and declaring all my public static variables, using a second namespace to place my main csv processing method and a third namespace to hold my additional methods for writing CSVs, and eliminating duplicates in a datatable. This made the whole program better organized and more legible but I did not see the purpose of adding more than once class to each namespace. It seems to me if I had written enough methods to justify needing a second class I would have added another namespace. Do classes just add an additional level to organize your methods within a namespace?

by spiderkiddid via /r/csharp

Leave a Reply