[Home Page] - [Reviews Main] | |
|
Visual C++ Object-Oriented Programming by M Andrews Recommended |
| ISBN: 0-672-30150-4 Publisher: Sams Pages: 1068pp & disk Price: £? |
| Categories: microsoft object oriented |
| Reviewed by Steve Page in Overload OL4 (Feb 1994) |
All the source code is supplied on the accompanying disk, although I am becoming personally a little fed up with having to pay a premium of more than 10 for a disk I may not wish to use. But no doubt others will vehemently disagree with me, as I know that at least one reviewer has been harping on about the lack of disks!
The 1066 pages (yes its a biggun') are split into three sections, covering
Visual C++ (9 chapters), Object oriented programming (10 chapters), and
Microsofts foundation classes (4 chapters). There are two appendixs which
covering an ASCII table and details of the Intel 80x86 chip set. The ASCII
chart is interesting, how often have you been stuck for a keycode and you
can't find a book with a ASCII chart? OK so the MASM ring bound reference
has got one, and there should be a TSR somewhere on a floppy
with one.... Shouldnt they be on the inside cover of every book by law?
The book is aimed at intermediate to advanced programmers, although I suspect that even beginners to C++ would find the book of some use, assuming they had basic understanding of programming. The reason for saying this is because the book launches of with a refresher of C++, for those of you who may have forgotten, or have experience of other languages. Part one in fact starts by comparing C against C++, explaining why C++ is the superior language and then leads in to a description of the Visual programming environment. Mark Andrews obviously thinks a lot of MSs product by the way he describes it, one can only assume he has not been victim to occasional bug which pops up! Having said that I notice that MS are now advertising v1.5 of Visual C++, although I have seen no announcements to the upgrade (do I sound bitter?) I was impressed to note that the description of the language included a the base data types and the way they are stored on disk. Its this sort of trivial information that saves one searching through Peter Nortons book on regular instances. By chapter four the book has reached variable declarations, and it is at this point that I had to disagree with Mr Andrews, he stated that the advantage (?) of C++ against C was being able to declare variables at any point in the program, rather than at the beginning of a function. This is not (to my knowledge) true, as certainly under MSC 6, you can define variables at the beginning of a block, not function, which can of course be started by a curly brace! I must confess that I personally like to see all variables defined at the start of a function, but can see the (dubious) benefit of being able to declare variables at a finer level. To be fair Mark Andrews does explain that he has a similar view, but feels it can aid the readability of certain code, if variables are defined close to where they are used.
It is good to see that the author not only shows the reader how to do things, but also how not to do things. One example is the use of references as parameters to functions that amend the passed references, far better to use standard C which will tell any programmer that the function may change the parameters themselves. These useful tips are displayed throughout the book by greyed out boxed sections. These greyed sections are also used to isolate Microsoft specific features, to avoid there confusion with the standard C++ used in the majority of the book.
The basic compiler and linker switches are dealt with in some detail, but not all obviously are covered. Section one completes with a discussion on memory management and DOS and windows memory models.
At this point the various methods of memory allocation in C/C++ are introduced, such as new and malloc. Section two starts off with a description of object oriented languages in general, leading into the use of C++ later, where most of the general features of the language are dealt with. This includes classes, member functions, function overloading and streams etc., so it could very well be used as an introduction book for a capable person. Andrew King uses the development of an adventure game, the wrath of Zalthar, to illustrate his teachings so there is plenty of source code examples provided throughout, which of course are contained on the accompanying disk. There are more than 450 pages devoted to this section, so it is quite comprehensive. As in section one, greyed boxes are used to highlight features and point out useful titbits for the more experienced reader, so even on a scan read, it is possible to pick up useful information. Section three is devoted to the Microsoft MFC libraries (v2.0), and here the game, Wrath of Zalthar is rewritten to take advantage of the MFC libraries. Sensibly the section starts with a discussion on error handling using the MS supplied macros. The classwizard part of the Visual Workbench is introduced at this point. This section is not written as a complete list of functions/classes, but more of a tutorial, introducing those features as needed to develop the game. At the end of the section a complete listing of the source code for Wrath is printed, which I find pretty pointless when one considers it is supplied on the disk, although I suppose it does make it more accessible to those who dont have a printer, or want reams of fanfold floating about!
In summary I found this to be an excellent book, which I would not hesitate recommending to someone who has just bought the MS Visual compiler, and needs some additional help with it. The book is detailed enough to provide a lasting reference to any one regularly using the language. Obviously it is heavily biased to the Microsoft product, so if you have one of the oppositions compilers you may wish to give this a miss, although if you know someone that has it, its worth borrowing just for a scan over section two, and a look at the source to Wrath (should that interest you). At $39, which probably equates to 32-39 I consider the book to be good value for money.
To link to this review, please use the URL: http://www.accu.org/bookreviews/public/reviews/v/v001341.htm
Copyright © The Association of C & C++ Users 1998-2000. All rights reserved.