Chinese New Year (2015) reading notes

Source: Internet
Author: User

2015 Spring Festival, living in the home of the new house, because of a variety of reasons have not power, let alone the network, so I am okay when I look at the "Tame Rotten Code" (Spring Festival home only for the family and stay together, so also rarely go out ...) )。 In the Mengmengdongdong is finished, although can not say what Taichetaiwu, but reading is always good, so, just make a note it. I also wish to remember the 2015 Spring Festival: Plain and true.

Tame code: Start with an example---as a clock manager, I want to synchronize the time of the different regions (time zones) displayed in the hotel by setting the time on the specific phone. Throw a bad code problem (program bug, Code "rancid"), and then throw a big problem after the problem----"test first or test after", of course, it is also a point of TDD (test-driven open advantages). Then explain what is bad code, how to deal with bad code (some simple can be directly corrected, some are used "todo" to indicate, to be followed by optimization), according to the user's intention to write test cases, curing the software behavior and step-by-step processing "TODO". Refactor the rotten code with divide and conquer (rewrite the code or refactor it according to the original code). By the thought of measurement (interface extraction or sub-class method overwrite), the program conforms to the five principles of object-oriented design (SOLDI). Finally, the unit test, the formation of personal habits (theoretical philosophy bar) and some environmental construction. Of course, the book also lists a number of examples of gradual introduction to the topic, and the final summary of each chapter is also a very classic.

I was impressed by the book:

First, organize and numbered the requirements list---draw out the use case diagram----use case diagrams.

Second, in a sentence to describe the user's topic needs: "As a < role, I want to pass < conditions, to achieve < purpose >." This is still more classic.

Iii. describe code implementation intent through "TODO" placeholder methods

Four, divide and conquer the thought, the code reconstruction, through the design principle realizes the interface extraction, the isolation, the function division, induces to the concrete class. Core

Five, TDD thought, test-driven development, very little contact, because I am involved in the development of the test. Did not say in depth with minimal test implementations. But this seems to be quite fun.

Six, the interface extraction, the third party class library encapsulation significance.

Seven, details. It is mentioned in the book that the Code management tool is written before commit message, and some shortcuts are worth learning by using these details.

"Tame Code" is a good book, I have not been able to understand the mystery, but only superficial knowledge, such as the core of its only one sentence (4th) name, obviously not enough. If there is an understanding of the wrong place, also ask the master to specify.

thanks! 2015-02-24

Chinese New Year (2015) reading notes

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.