C # Program Coding specification

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.