"C++ Programming for the Absolute Beginner" by Dirk Henkemans, Mark Lee. Is it good?

Started by
6 comments, last by jfclavette 18 years, 7 months ago
I was gunna order this book, but then I started thinking... Of all the books I've seen being suggested here, I don't remember seeing this one. Is this one not a good pick to start learning C++ with or something? [Edited by - Lucky Ace Card on August 19, 2005 3:11:58 AM]
Advertisement
I don't recommend it since it uses a lot of bad coding examples.
For instance using

cout << name.c_str();
when you could just use
cout << name;
where name is a string.
And anytime a the first program in a book starts with
int main(void)
it can only get worse.
I should also state that most of the functions throughout the book use
void function(void); which is valid to support old C code but
void function(); is preferred these days.

Since I'm currently going through book again other major snafu's I've come across include:
classes with no default constructors defined when a constructor that takes parameters is declared.

enum used in example games and not explained in book
main game loops like:
while(!player1.taketurn && player2.takturn)
{
}
etc...

The only good thing in the book is the cool sid meier's pirate clone game at the end but even that won't compile with latest directx sdk since it used older directx dxutil library stuff to load bitmaps.

[Edited by - daviangel on September 9, 2005 11:31:02 PM]
[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe
Beginning C++ Game Programming
by Michael Dawson
is the only beginning c++ geared towards game that is on the ACCU "recommended" book list and I can personally say it is very good since I have a copy of the book too!
[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe
I used that book to start laerning c++, as the above poster said the pirate clone game doesn't really work anymore as its directdraw based (really not worth the hassle now). There are a lot more modern books available now, so go for one of them, if you already have the book, or can get it very cheaply, then its still useful to learn, but be ready to buy a more modern one when you can.
In the interest of fairness.

Quote:Original post by daviangel
And anytime a the first program in a book starts with int main(void)it can only get worse.


This is perfectly valid.

Quote:
classes with no default constructors defined


There's no need to provide a default constructor when it is trivial or indeed unwanted.

As for a suggestion, Accelerated C++ is what I usually recommend.
I teleported home one night; With Ron and Sid and Meg; Ron stole Meggie's heart away; And I got Sydney's leg. <> I'm blogging, emo style
Quote:Original post by xMcBaiNx
In the interest of fairness.

Quote:Original post by daviangel
And anytime a the first program in a book starts with int main(void)it can only get worse.


This is perfectly valid.


yes, but there are certain ways the majority of people write code that books should conform to. Although this isn't that bad, let's say someone wrote:

int main(void)
{int i = 0;
etc...
return 0;}

that's valid too and not too hard to read, but i wouldn't buy a book if i saw that. int main(void) isn't bad, it's just not common, and i prefer books that show people how code is commonly written.

Quote:
Quote:
classes with no default constructors defined


There's no need to provide a default constructor when it is trivial or indeed unwanted.


yes, but IMO it's bad practice.

I haven't read the book, so I'm not really judging that. These are just my opinions.
Some books write this in the begginning ,but later they tell you what to do so its not actually incorrect ,but I wouldn't conside it "good"
Quote:Original post by SpacedOut
Quote:Original post by xMcBaiNx
In the interest of fairness.

Quote:Original post by daviangel
And anytime a the first program in a book starts with int main(void)it can only get worse.


This is perfectly valid.


yes, but there are certain ways the majority of people write code that books should conform to. Although this isn't that bad, let's say someone wrote:


The standard stipulates that main has two possible signatures.

int main(void);int main(int, char **);


Those are both correct and widely used. Why would you use the second one if you don't expect command line parameters ?



Quote:
Quote:There's no need to provide a default constructor when it is trivial or indeed unwanted.

yes, but IMO it's bad practice.


It's GOOD practice. If your class has no ue for a default constructor, don't write one !

Case in point:

class Children {  Parent& _mother;  Parent& _father;public:  Children(const Parent& father, const Parent& mother) : _mother(mother), _father(father) {}}


A Child always have a mom and a dad, why would you want to provide a default constructor (assuming no other constraints force you to).
I teleported home one night; With Ron and Sid and Meg; Ron stole Meggie's heart away; And I got Sydney's leg. <> I'm blogging, emo style

This topic is closed to new replies.

Advertisement