Summary of the company's high-quality Coding

Source: Internet
Author: User

In the company forum, I saw a post called "high quality coding is required", which was developed by the Technical Research Department. There is a PDF in the attachment, curious. I downloaded it and read it, I think it is not bad, so I would like to share with you some of the key points that I think are more useful. If you are interested, you can download the file and read it. The content is easy to understand and is very suitable.

 

1) Tools

Duplicate search using teamcity finddupCodePoint (I have never used or found any related tools. Please let me know if I have used them)

Use dpack to locate functions and classes (I have never used them or found any related tools. Please inform anyone who has used them)

Search for files using everything

Automatic and secure reconstruction using coderush

In addition, I recommend a tool, SQL prompt 5, which can be easily used in sqlserver. It mainly includes table fields and functions and smart prompts for stored procedures, in addition, you can easily find any code in the Stored Procedure view of the function, a convenient tool.

 

2) Key Points

A. Naming complies with Microsoft naming. You can use project properties-code analysis Microsoft. NamingProgramTo see these rules, let's look at the excellent code, increase the vocabulary of words, and use the tool reflector or word overlord.

B. checkerror to reduce the complexity. Use the if else swich statement as little as possible to improve code readability.

C. When concatenating parameter strings, use format instead of + to improve readability. It is common in dynamic SQL assembly and can be automatically and securely reconstructed using coderush.

D. The fewer dots, the better, and the better reading ability.

E. Select the return value type (bool, Enum, number, string) in the following order of priority)

F. The existence of the annotation is the information of the segmentation method. The responsibility of the method should be more uniform. The more comments, the more they indicate that they can be further decomposed.

G. Be good at simplifying codes with operators, including + =,-=, ++ ,??,? :. For details, see the PDF document.

 

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.