Welcome to the new Tigris! There have been some changes to the administration of mail lists. Project and list owners should check out the Discussion Services release notes.
Style Guidelines
for
Advanced Unit Testing Project
I don't want to be too heavy handed with style guidelines, so hopefully everyone can live with them. Since there is already a considerable code base, I'd rather not adopt a style that requires a significant amount of refactoring, and I certainly don't want to mix styles. So here we go...
The following describes general document styles.
Set tabs to 4 spaces (the default)
"Keep tabs" is preferred but optional
80 column margins can definitely be exceeded for readability. I realize some people like to print code, but forcing a margin, splitting lines, etc., for the sake of printing is not desirable.
Filenames start with an upper case letter (Pascal case)
The following conventions come from http://www.irritatedvowel.com/Programming/Standards.aspx, .Net Standards and Best Practices. As we're already following them (or nearly so!), I see no reason to change.
AppliedIS.TimeCard.BusinessRulesIrritatedVowel.ControllersPeteBrown.DotNetTraining.InheritanceDemo PeteBrown.DotNetTraining.XmlAppliedIS.TimeCard.BusinessRules.dllIrritatedVowel.Controllers.dllWidgetInstanceManagerXmlDocumentWidgetCollectionWidgetCallbackDelegateInvalidTransactionExceptionWebServiceAttributeIWidgetSearchOptionsPublic Sub DoSomething(...)
C#: public void DoSomething(...)
Public Property RecordID As Integer
C#: public int RecordID
ByRef recordID As Integer
C#: ref int recordID
Dim recordID As Integer
C#: int recordID ;
Private _recordID As Integer
C#: private int _recordID ;
txtUserID, lblHeader, lstChoices, btnSubmit* Public class-level variables are generally frowned upon. It is considered to be a better practice to use property procedures to provide read and/or write access to a private member variable. If you must expose a member variable to other classes using "Public", follow the property naming conventions.
You Can find the standards for publically exposed classes/properties etc at MSDN. If you want to run a tool to validate your code for public standards and required practices, download FXCop.
NOTE: If you use strongly-typed datasets, you will find it makes a lot of sense to follow the PascalCase naming convention with your database tables and fields as well. That is because strongly-typed datasets are simply classes with properties for table field names.
A brace appears on a new line at the same indent level as the preceding line. Code within the brace is indented one level.
Example:
for (int i=0; i<10; i++)
{
// more code
}
You are viewing a mobilized version of this site...
View original page here