Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A class per file or multiple classes per file?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01124405
Message ID:
01124409
Vues:
9
This message has been marked as a message which has helped to the initial question of the thread.
>Coding in C#, which is a better practice: put one class per file and allow the file share the same name as class name (like in Java) or put multiple classes in a file (like in VFP)?
>
>I'm inclined toward the former since it's easier to find a class by just looking at the file name.

I prefer to always put one class in one file. Among other advantages, this allows me to visually better recognize the Imports declarations to the class. If I have multiple classes, it is not obvious to which class the Imports declarations are used into. I also name the file as per the class name. So, this is also another advantage I have found.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform