unnecessary Class files in application.  
Author Message
mayur8u





PostPosted: Visual C# General, unnecessary Class files in application. Top

Hi,

Creating seperate Class file for each Enum in the application, will this effect the application perfomance

To make the above question simple, Creating unnecessary Class files, effect the performace of an application

Thanks in advance,

Mayur M




Visual C#6  
 
 
Jeff Wharton





PostPosted: Visual C# General, unnecessary Class files in application. Top

Not really, but why would you want to do that anyway

 
 
RizwanSharp





PostPosted: Visual C# General, unnecessary Class files in application. Top

Its better to split up code in different files for readability and it doesnot hit performance because at runtime its dealing with assembly which is compiled version of your code in form of Intermediate Language and there is no concept of seperate files...

So for better readability its better to use seperate files with the name of enum ......

Best Regards,

Rizwan



 
 
Mark Benningfield





PostPosted: Visual C# General, unnecessary Class files in application. Top

Hello All.

mayur8u:

It all depends on your situation. If you aren't bound by house rules, then it's completely up to you. If you have several short classes that are conceptually related (even if not logically related) then it might make sense for you to put them in the same text file. The whole concept of maintainability really depends on what makes the most sense to the most people involved. So, if you're in a development house, then it is decided (hopefully) up front what the procedures are so everyone is on the same page.

If it's just you and the cat, then you decide which way to do things so that it makes the most sense to you. The key is CONSISTENCY!!!! Whichever way you decide to do things, then do them that way all of the time, every time. That way, your project will still make sense to you when you come back to it months later.

As far as performance goes, there's no correlation. All of the code files in your project are simply text files. The compiler will gather them all up and combine them into the relevant number of assemblies, so it all goes in the chili, so to speak.

HTH.



 
 
Jeff Wharton





PostPosted: Visual C# General, unnecessary Class files in application. Top

This is true to an extent, however if you have 10 enums and you split them into ten classes that only conatin the enums, this does not help readability at all. It confuses the matter. OO does not mean create as many objects as you possibly can. A better solution would be to put ALL your enums into one class.