|
| Login | Sign up | My Wish List |
![]() | Computer Science: A Structured Programming Approach Using C++ by Behrouz A. Forouzan, Richard F. Gilberg ISBN-10: 0534952070 ISBN-10: 0-534-95207-0 ISBN-13: 9780534952075 ISBN-13: 978-0-534-95207-5 Spiral-bound 1999-02-22 Wadsworth Publishing Company Find Lowest Price | |
Editorials | ||
Book Description This book, in the words of the authors, "teaches students first how to write good functions, and then how to implement them in classes." Designed for students with no prior programming experience, the book explains each basic principle of programming first in general, language-independent terms, and then discusses how the programming construct in question is implemented in C++. Given this approach, classes are presented in the second half of the text. The book incorporates coverage of software engineering principles and procedures throughout (starting with flowcharts), with each chapter concluding with a discussion of underlying software engineering concepts. Unlike competing books that are too difficult for first-year students, Forouzan and Gilberg take special pains to make their programming examples consistent and easy to read. This careful writing makes this book a solid choice for professors looking for a book that is easy to read and follow, without compromising the material's rigor. | ||
Reviews | ||
I wish I could give this a zero! Spend your money wisely and get another book. This book is poorly written in what seems to be a foreign language. The phrase "it's Greek to me" certainly applies here. This book contains grammatical and spelling errors alike. The coding is incomplete and as a student of C++ I find it outrageous that computer science professors require this book as a textbook. All in all do not buy, try C++ Primer Plus. | ||
I'd be even madder if I'd bought it new This is the text for my C++ class, so I did not buy it by choice. It's terrible! The people in class who are new to programming are having a hard time. Often the authors use imprecise language. There are many errors of omission: sometimes there is backpedaling or an explanation later. It says a lot that the non-programmers in the class can almost always tell when a statement in the book isn't quite right, even if they don't know why it isn't right. You have to wonder if there was a technical review of this text. And I can't figure out how it got chosen as a text for any class anywhere. One, the authors did not mention which compiler they used to compile their program examples. Many of the programs do not compile in MS Visual C++ 6.0 as written in the text. The authors fail to mention you might have to modify the code to get it run on your compiler. For instance, Two, I often disagree with the authors' definitions. My favorite example: the statement Three, some of the "good programming" tips would cause me to fail code inspections at work. This is a good thing, because they would make verification and maintenance a nightmare. Like not initializing variables when they are declared. I guess the authors have never seen weird things happen as an executing program tries to deal with the garbage in an uninitialized variable. Or maybe they just figure this is a good way for you to discover you forgot to initialize a variable before first use. It just might take a while to figure out that's what's going on since the results can be unpredictable and/or bizarre. I could continue, but I think I've more than made my point. I won't be standing in line to get the second edition when it comes out next year. | ||
easy to read easy to read, helpful excercises, a good book for those who want to learn C++ programing | ||
Excellent for beginning students! Great choice for new students to programming. | ||
Don't walk away from this book: run! From the back cover: "[...] no matter how powerful the language, it is still far too easy to write poor programs. [...]". The code examples in this book prove exactly this point. The authors mention the ISO/ANSI C++ standard and claim to follow it "wherever possible" (sic). However, they make so many false statements that I seriously doubt that they have ever consulted the ISO/ANSI Standard documents, or any of the excellent text books on modern C++ design and coding practice (Cline, Meyers, Sutters.) I believe (and I'm not alone) that in a modern C++ course std::vector should be introduced before arrays, and std::string before const char*. Not only are they safer, they are also *a lot* easier to use, and make it possible to come up with more interesting programming exercises than the endless array of meaningless numerical computations. Unfortunately, many instructors and authors consider std::vector and std::string to be "advanced topics", and torture their students and readers with the old stuff they had to learn themselves ten or more years ago. The authors belong to this category, I'm afraid: they learned C, and think that they know C++. Let's have the book speak for itself. Page 28: "While C++ allows declarations and statements to be intermixed, we believe that functions should be organized for readability. Therefore, we continue to follow the C organizational concept that places declarations first in a function, followed by its statements." On a related note, on page 40 the authors write: "One final point about initializing variables when they are defined: Although the practice is convenient and saves you a line of code, it also can lead to errors. It is better, therefore, to initialize the variable with an assignment statement at the proper place in the body of the code. This may take another statement, but the efficiency of the program is exactly the same, and you will make fewer errors in your code." (My comments:) It is commonly accepted by knowledgeable C++ programmers that the practice of declaring variables near the point of their first use in one of the things that makes C++ a better C. It is the old style that leads to errors (forgetting to initialize variables) and maintenance problems (variables that are no longer used, but are still in the declaration section). Furthermore, it is considered good style to prefer initialization ( int sum = 0; ) over subsequent declaration and assignment ( int sum; sum = 0; ). The former is always more efficient, and the difference can be substantial when dealing with large objects for which construction is expensive. You may argue that this is of no concern for beginning C++ programmers, but I disagree; habits, both good and bad, form early. -- From the code example on page 363: bool binarySearch (int list[ ], int end, int target, int &locn){ ... } (My comments:) The first argument should be const-qualified: const int list[ ] Not only does this protect the programmer from inadvertently changing any of the values stored in the array; it also makes it possible to use the function with const int[] arguments (which would fail to compile with the original code). The const keyword is an important asset of the C++ language, and students should be trained to use it properly from the beginning. Using the Standard Template Library will drive programmers who are not aware of const-correctness issues insane. The book is extremely sloppy in the const-correctness area. -- Page 119: "If a function has not been declared or defined before it is used, C++ will assume that you will provide that information when you link the program. Since there are no specifications, C++ will also assume that the return type is integer and that the parameter types correctly match the formal definitions." (My comments:) This is not true: in C++, functions have to be declared before they are used, and there is no such thing as 'implicit return type int'. C++ really is different from K&R-style C. -- On page 195, the following insight is highlighted: "The else-if is an artificial C++ construct that is only used when 1. The selection variable is not an integral, and 2. The same variable is being tested in the expressions." (My comments:) No further questions here, your honor. -- It gets really interesting when the authors express their ideas on Object-Oriented programming. They claim that Object-Oriented programming is just a different view, but that the implementation is exactly the same as in structured programming. They are probably misguided by their own example of an elevator simulation program (in the chapter on classes), which is simply a structured program wrapped in a class, and has nothing to do with OO. | ||