A detailed introduction to the clean code

Source: Internet
Author: User
From the perspective of development, we should organize variables and functions according to certain naming and formats. Next, we will write code. in the industry, many developers advocate test-driven development, next, let's talk about unit testing. TDD is short for Test-DrivenDevelopment. it is a core practice and technology in agile development and a design methodology. The principle of TDD is to write unit test case code before developing function code. 1. Three Laws of TDD: before writing unit tests that cannot pass, you cannot write Production Code... from the perspective of development, we should organize variables and functions according to certain naming and formats. Next, we will write code. in the industry, many developers advocate test-driven development, next, let's talk about unit testing. TDD is short for Test-Driven Development. it is a core practice and technology in agile Development and a design methodology. The principle of TDD is to write unit test case code before developing function code. 1. Three Laws of TDD: Production code cannot be written before unit tests that fail to pass. Law 2 can only write unit tests that are just unable to pass, and can neither compile nor pass. Law 3 can only write production code that is sufficient to pass the current failed test. Write the test code together with the production code. the test is only a few seconds earlier than the production code. 2. keep the test code as clean as the production code, and keep it clean. Testing brings all the benefits. The neat unit test code brings many benefits to your code. The more dirty the test is, the more dirty the code will eventually become. If a test is lost, the code begins to rot. 3. a clean and tidy test is very important.

1. share today: clean code-Unit testing

Overview: Directory overview variable function objects and data structures test concurrent error handling format comment overview Robert TC. Martin in code...

4. Read the Clean Code

Introduction: I recently carefully read CleanCode when I was busy with public transportation. I once again admire Uncle Bob's humorous essays, his own point of view and understanding. What impressed me most is Uncle Bob's solution to data structures and objects.

[Related Q & A recommendations ]:

The above is a detailed introduction to the clean code. For more information, see other related articles in the first PHP community!

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.