C++ / a working model

BOOK / SOURCE & READING RECORD

Programming: Principles and Practice Using C++

Bjarne Stroustrup

2nd edition,2014年5月;作者公开章节含2015/2016修订页,未以第三版替代

READING EVIDENCE / Partial text read

Programming: Principles and Practice Using C++

Read all available text, code, Drill, Review, Exercises, terms/index of second edition chapters 0–27 and appendices A–E; among them chapters 1, 11, 22–25, 27 and Glossary were additionally read using the author's complete chapter PDFs. Author chapters total 294 printed pages; key missing pages, tables, and figures in chapters 11/22/23 have been supplemented by reading images. The remaining public full-book OCR still has damaged code and unrecovered graphics/tables, especially chapters 12–16 graphics and GUI, therefore it is not claimed that the original edition was read through without gaps in text and images; exercises were not run.

Edition, actual reading range, and original sources →

Sources

Programs help you clarify the problem, not just implement the answer

§0.2 Teaching and learning philosophy;Chapter6—7 Calculator;Chapter10 Input and Output Streams;§11.7—11.8;Chapter26 Design for testing

PPP puts input, errors, types, and debugging into the same set of gradually developing practical problems. The calculator does not have a complete architecture from the start, but gradually separates responsibilities as lexical analysis, syntax, variables, and recovery strategies appear; this is not encouraging lack of planning, but letting the implementation expose requirements that have not yet been thought through. Input processing is similar: successful field conversion, legal range, complete record, and valid output object are four different promises. This site uses limited string parsing to demonstrate establishing candidate values first then committing, avoiding erroneous records leaving a half new piece of data. The Graph_lib in the textbook is for teaching, the prediction of C++14 concepts was not an ISO-published feature at the time; modern reading needs to distinguish persistent engineering principles, the library environment of the time, and transcription defects.

Related fundamentals

Exception Safety: Guarantees, noexcept, and Commit PointsConstruction and destruction orderAlgorithms: sort, boundary search, and erase-remove

Original practice →