DOCUMENT:Q128757 01-SEP-1998 [mspress] TITLE :CODE COMPLETE: Corrections and Comments PRODUCT :Microsoft Press PROD/VER: OPER/SYS: KEYWORDS:kbdocerr ====================================================================== kbother kbdocerr ---------------------------------------------------------------------- The information in this article applies to: - Code Complete ISBN 1-55615-484-4 ---------------------------------------------------------------------- SUMMARY ======= This article contains comments, corrections, and information on known errors relating to the Microsoft Press book "Code Complete." The following topics are covered: - Page xviii: Miscellaneous corrections - Page xviii: Internet e-mail address change - Page 241: Text Change - Pages 48-853: Correction list summary (first printing) - Pages 313-455: various corrections made to 7th printing - Pages 332-708: Corrections made in the 11th printing MORE INFORMATION ================ In addition to a description of the book's problems, each entry in this document might also include sections labeled "Correction" and "Comments." Please note that the "Correction" section is worded for correcting the book and does not necessarily address the problem introduced by the book error. The "Comments" section contains specific information for working around the problem. Page xviii: Miscellaneous corrections ------------------------------------- Page xviii: Change: "parctices" to "practices" Change: "thatn" to "that" Change: "setvemcc@construx.com" to "stevemcc@construx.com" Note that these errors appear only in the ninth printing of "Code Complete." They were fixed in subsequent printings. Page xviii: Internet e-mail address change ------------------------------------------- On p. xviii, last line, change "on Internet as stevemcc@seattleu.edu" to "on Internet as 73133.622@compuserve.com" Page 241: Text Change --------------------- p. 241, 6th paragraph, 2nd sentence. Change to read "The BCD scheme is slower and takes up more storage space but prevents many common rounding errors." Pages 48-853: Correction list summary (first printing) ------------------------------------------------------ The following is a summary list of corrections for the first printing of this book. Page 48, 2nd paragraph, last 2 sentences. Should read: "IBM popularized Basic on microcomputers by including a Basic interpreter with the IBM PC. It is now commonly available in both interpreted and compiled forms." Page 48, last paragraph, line 3. Change "Jim" to "John". Page 96, 1st code fragment. Test for "<> NULL" should be "<> nil" Page 96, 2nd code fragment. Test for "<> NULL" should be "<> nil" Page 176. The sentences in the paragraph below the code fragment that currently reads In a development environment with a group of programmers, only the package specification would be released. It would be impossible for a programmer working on another package to look up the underlying type of Coordinate_t. The information is literally hidden. should be replaced with the following: In a development environment with a group of programmers, you could distribute only the package specification, which would make it harder for a programmer working on another package to look up the underlying type of Coordinate_t. The information would literally be hidden. Page 204, code fragment at bottom of page. Two lines should have "i"s added to read: ipaReformat = ipaFirstReformat; ipaReformat <= ipaLastReformat; Page 205, first paragraph, first line. Change paLimReformat to ipaLimReformat and paLastReformat to ipaLastReformat. Page 205, first code line. Change paLimReformat to ipaLimReformat Page 205, second code line. Change paLastReformat to ipaLastReformat Pages 256-7. The code fragment that begins on page 256 and continues on page 257 should be replaced with the following: void insert_link ( NODE * CrntNode, NODE * InsertNode ) { /* insert "InsertNode" after "CrntNode" */ InsertNode->Next = CrntNode->Next; InsertNode->Previous = CrntNode; if ( CrntNode->Next != NULL ) { CrntNode->Next->Previous = InsertNode; } CrntNode->Next = InsertNode; } Page 257. In the sixth line of the first text paragraph, "CrntNode.Next" should be replaced with "CrntNode->Next" Pages 257-8. The code fragment that begins on the bottom of the page and continues onto the next page should be replaced with the following: void insert_link ( NODE * StartNode, NODE * NewMiddleNode ) { NODE * FollowingNode; /* insert "NewMiddleNode" between "StartNode" and "FollowingNode */ FollowingNode = StartNode->Next; NewMiddleNode->Next = FollowingNode; NewMiddleNode->Previous = StartNode; if ( FollowingNode != NULL ) { FollowingNode->Previous = NewMiddleNode; } StartNode->Next = NewMiddleNode; } Page 258. In the first paragraph, second line, the expression "CrntNode.Next.Previous" should be replaced with "CrntNode->Next- >Previous" Page 332. In the second code fragment, the expression "InputRec[ RecCount ]" should be replaced with "InputRec[ RecCount-1 ]" Page 461, code fragment at bottom of page. 4th line should be changed from Sum := 0; to Sum := 1; The 8th line reading OldSum := Sum; should be deleted. The 11th line should be changed from Crnt := OldSum; to Crnt := Sum; Page 471. In the second code fragment, the line that reads "MaxPos := Length( InputStr );" should read "MaxLen := Length( InputStr );" Page 701. In the line of code inside the for loop at the top of the page, "Quantity" should be replaced by "Net" Page 709. In the code fragment at the bottom of the page, in the comment line, the order of the "BC" pairs should be changed to read in the following order: "/* !B!C !BC B!C BC */" In the line below the comment line, the "0, 2, 3, 2" sequence should be switched so that it reads: "0, 3, 2, 2" In the line below that one, the "1, 1, 2, 1" sequence should be switched so that it reads: "1, 2, 1, 1" Page 719, code fragment at bottom of page. The 3rd line of code should be changed from Value = Value + Coefficient( Power ) * x to Value = ( Value + Coefficient( Power ) ) * x Page 734. The page numbers in the table are wrong and should be corrected. They are all off by 4. To get the right page number, take the current page number and subtract 4. Page 802. In the first full paragraph from the bottom of the page. Replace the last sentence in the paragraph (the one that begins "To get a copy of his report...") with "A copy of the report is included as an appendix to Decline & Fall of the American Programmer (Yourdon 1992)." Page 803. Change the paragraph that begins "Computer Language" to "Software Development". Also change the phone number in the same paragraph from 800-288-1322 to 800-950-0523. Page 826. After the paragraph that begins "Yourdon, Edward, 1989b" insert a new paragraph: Yourdon, Edward, 1992. Decline & Fall of the American Programmer. Englewood Cliffs, N.J.: Yourdon Press. Page 838. Index entries for "flawchart" should be added. The only time it's referenced is on page 57. Page 849. The entry for The Psychology of Computer Programming should have the following page number added: 771. Page 853. The index entries for the books Software Tools and Software Tools in Pascal are missing and should be added. The page references are as follows: Software Tools, 497, 511-12 Software Tools in Pascal, 497, 511-12 Pages 313-455: various corrections made to 7th printing ------------------------------------------------------ Page 313. In the second line in the code fragment, the test should be for "<>" rather than for "<". Page 395. In the last paragraph, - Delete the phrase: "described in Table 17-2," - At the end of the paragraph, add the sentence: "Table 17-2 describes a method for counting decision points." Page 395. In the last line of the table, delete the sentence: "If the case statement doesn't have a default case, add 1 more." Page 455. The second block of code in the second code example should be modified in several ways: - The "for" line should have a "begin" appended to the end. - The "begin" in line 4 of the block should be moved to the end of the preceding line. - The "end" currently at the end of the block should be outdented to left align with the "while" above it. - At the end of that block, after the first "end;", a line should be inserted with another "end;". The new "end;" should be left aligned with the "for" above it. The result of all that should look like this: for Factor := 2 to Num / 2 do begin FactorableNumber := Factor + Factor; while ( FactorableNumber <= Num ) do begin IsPrime[ FactorableNumber ] := False; FactorableNumber := FactorableNumber + Factor; end; end; Pages 332-708: Corrections made in the 11th printing ---------------------------------------------------- Page 332, code fragment 2: Change: fgets( InputRec[ RecCount - 1 ], MAX_CHARS, InFile ) To: fgets( InputRec[ RecCount - 1 ], MAX_CHARS, InFile )) Page 347, paragraph 3, sentence 1: Change: "...that don't support structured controls correctly." To: "...that don't support structured control constructs correctly." Page 540, Table 22-1, Possible Range of Factor's Influence column: Change: "1.40" To: "1.49" \* Page 562, margin quote: Change: "Andy Grove" To: "Tom Peters" \* Page 707, bullet 4, sentence 1: Change: "...put a negative sentinel value in the first element past the end of the array..." To: "...put a negative sentinel value in the first array element after the last valid data entry..." \* Page 708, paragraph 1, sentence 2: Change: "...the effect is the same as if..." To: "...the effect is often the same as if..." Microsoft Press is committed to providing informative and accurate books. All comments and corrections listed above are ready for inclusion in future printings of this book. If you have a later printing of this book, it may already contain most or all of the above corrections. Additional Reference Words: mspress ms_press press bookbug Steve McConnell KBCategory: kbother KBSubcategory: kbdocerr ====================================================================== Keywords : kbdocerr ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 1998.