-
Files?
I recently started with C# but I can't help wondering about the way you build the program. In C and C++ you create a bunch of different C and H files and use the #include statement to merge them. But in C# it sems like everything is just one huge CS file. Is it always that way or will a different way present itself towards the end of this book?
-
Well, as in C++, sooner or later the compiler will merge it into one big mess. Normally, you should have one file per unit. Each class should have it's own file and each interface or struct, too.
But that's style, not a compiler requirement. Other people may prefer other styles.
-
I also like to seperate my classes. One class per file. In Java I group alike classes in packages. I haven't attempted this in C# yet because my applications have been under 4 classes. It's normal for one of my 2 week projects at work to hit ~50 classes. :o