C # Introduction to different java programming styles

Source: Internet
Author: User

More formal programming style
Trim adds a space to each side of a binary operator.
The Delimiter is followed by a comma instead of a space.
Add a space after each keyword
Statement in a row
Do not have spaces before the semicolon (;).
No space is added between the brackets and parameters of the callback function.
Trim does not add spaces between the unary operator and the operand.
Add a space to each side of a binary operator:
Console. WriteLine ("{0}", result/13); // recommended
Console. WriteLine ("{0}", result/13); // not recommended
Add a space after each comma instead of before:
Console. WriteLine ("{0}", result/13); // recommended
Console. WriteLine ("{0}", result/13); // not recommended
Add a space after each keyword:
If (OneLine (comment)... // recommended
If (OneLine (comment)... // not recommended
Do not have spaces before semicolons:
Console. WriteLine ("{0}", result/13); // recommended
Console. WriteLine ("{0}", result/13); // not recommended
No space is added between the brackets and parameters of the function:
If (OneLine (comment)... // recommended
If (OneLine (comment)... // not recommended
There is no space between the unary operator and the operand:
++ KeywordCount; // recommended
++ KeywordCount; // not recommended
Author: ershouyage

Related Article

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.