This specification applies to all C #-based development. NET Platform project, providing reference and basis for detailed design, code writing and code review.
First, the code format
To make all indents a tab, that is, 4 spaces, use the default settings for Vs.net.
Align the opening and closing brackets vertically in your code.
To prevent scrolling through the source editor while reading the code, each line of code or comment should try not to exceed a display at the resolution of 1024x768, as if the line should be wrapped and the code after wrapping should be indented one tab.
When a row is divided into several rows, the concatenation operator is placed at the end of each line rather than at the beginning, clearly indicating that no subsequent rows are incomplete.
The statements placed on each line avoid more than one, avoid writing int i = 0;int j = 1;
Spaces are used before and after most operators, and doing so does not change the intent of the code but makes the code easier to read. Example: Int J = i + K;
And should not be written as int j=i+k;
Divide large, complex code sections into smaller, easier-to-understand modules.
When writing SQL statements, it is recommended (not forced) to use all caps for keywords and mixed case for database elements such as tables, columns, and views.
Placing each major SQL clause on a different line makes it easier to read and edit statements, such as:
SELECT FirstName, LastName
From Customers
WHERE state = ' WA '
C # Program Coding specification