by Paulo Morgado via Paulo Morgado : C# on 5/23/2007 11:29:32 PM
Following up on a previous post, this time I'll give you my naming conventions for partial class files.
There are two main reasons for me to break a class definition into more than one file. The main one is when I have inner classes and the other is when the file is getting too big.
How should I name the files? The usual tendency is to use a “.” as separator. This looks nice until you came across something like this:
public class MyComponent
{
private class Activation
// Class implementation.
}
private class Deployment
#region Event Handling
// Event handling code.
#endregion
If I would extract the inner classes and use the “.” as separator, I would end up with the following list of files:
And, what about the long event handling code? Should I do the same? If so, I will end up with the following list of files:
This doesn’t look very nice, does it?
So, here is my proposal:
This way, I end up with the following list of files:
And this looks a lot nicer.
Original Post: My C# Naming Conventions For Partial Class Files
The content of the postings is owned by the respective author. CSharpFeeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on CSharpFeeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.