Why programming C++ in a book is a bad idea.
By: Akbar Ali(syedali011@earthlink.net)
May 11, 2000

Well, i have been reading Inside Direct 3d (by: Peter Kovach), for a few hours now. Just thought i might take a break for a little while to inform you on how i feel about C++. Let's get some things cleared up here, we all know that the world is moving to C++.
I just thought that i might say a few words about it, and the way people write books.

C++ is a good language to use for commercial applications and for programming on your own. It has many features which come very handy in commercial applications, large scale systems, and finally games. A few of these to not would be the *templated* types, Abstract class heirchary, and virtual functions.
But i can honestly say, in a book that teaches a software programming Api it should try it's best to stay away from c++ syntax as much as possible.
The whole purpose that c++ was designed and constructed was to make *large* scale programming efforts easier and *abstract* certain areas of system designs.
Basically what that meant was, the physics guy would not have to worry about the underlying input routine because he had members which did all the checking and work for him. When you read a book you want to learn what is behind it all, and how to work the effects etc..
By clouding this into a very bloated class you make it much more difficult to follow through.

If you are a book writer and your topic is not about the Design and Implementation of C++ then *please* refrain from using C++ code in your book. Sure some parts in your books *need* C++, but most of the time if it is a book concentrating on "coding to the metal" refrain from c++ code.
And another thing before I close, I am sure a lot of you book writers think that you will be critically acclamied for your *knowledge* of templated datatypes, and that you *know* how to use good abstraction in your code, have a bunch of *freinds* and namespaces, etc... Why don't you write a commercial application ? ;)

Just rember one thing, you are writing a BOOK.
If the intention of writing the book is to *help* others learn an api. Then why bother with features of a language. Stick to the  API (applications programming interface) !!!
I can't really look down upon Peter in this book, he has done pretty good with the C++. DirectX and C++ are *very* closely related. Imho peter made a good decision by opening up a lot of those variables to a global namespace. I felt that this was really smart of him.
keep up the good work peter. I will be doing a review of the book later this week.

thank you.
peace.
akbar A.