Should you create separate file for new enum in .NET?

Date: 20 Feb 2010 Comments: 0

You may become in the following situation: You have some class and you want to add some enum for it, then you begin wandering should you add a new file for the enum.

I think if the enum will be used by a single class then you should add the enum declaration inside the class. But if the enum is global and will be used by many classes you can create a new file where you can add declarations of all globally used enums. But to create separate files for all enums it too wasteful :)

Leave a Reply


Spam protection by WP Captcha-Free