Training for employees of the Company 1: Micro-standards

Source: Internet
Author: User
On that day, I conducted a program specification training for new employees of the company. I divided these specifications:
1) Micro specifications.
2) macro specifications.
First, let's talk about micro-standards.
First, contractual programming. This is the specification of the link between processes, functions, and functions. Like the workers on both sides of the assembly line. If the worker in the next process starts to use the parts produced by the worker without checking the parts produced by the previous process, the worker shall take responsibility even if there is a problem with the parts of the superior worker. If he checks for problems before use, the workers in the previous process will be responsible. Therefore, when a higher-level worker passes down a part, check it first. Similarly, if Program When passing parameters, the function of member A does not check and outgoing incorrect values, so programmer A needs to be responsible. However, if the next-level programmer B does not check, it is the responsibility of programmer B to have problems. Requirement: when passing in and out parameters, the function must make judgments to eliminate errors within the minimum range.

Second, assertion. We are releasing the program Code Debugging is required before, and assertions can be made during debugging.
Example (C #): system. Diagnostics. Debug. Assert (keyword. length> = 3 );
In the above example, if the length of keyword is less than 3, an error will pop up and you will be asked for further operations. However, this code is not executed in the release. This is advantageous. Writing more code will not affect the release version.
Of course, we need to add the following sentence: If (Keyword. Length <   3 )
{
Return Null;
}

This is for the release version.

The above two are important and there are other standards. The document is on the card. Remember to write it again.Article.

there are several basic principles on the macro level: three layers, MVC, and object-oriented. This article will be discussed later.
finally, there are tests, including unit tests.
if you have time, write another object-oriented analysis technology.

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.