[2002-11-19]

Book Reviews from 2002

 

Essential C++

By Stanley B. Lippman

 

(image missing) This book on Amazon

I have a hard time placing this book. Though it "waste" one chapter on "Procedural Programming", I don't think complete newbies is the target audience. I think its place is as as an intermediate step after Accelerated C++ for those who want to slowly ascend by working the exercises in this book, rather than going for something more reference-like.

This book covers some of the same ground as Accelerated C++, but is over all a little more advanced. The basics, like working with the STL, is there. Generic programming is covered, though not extensively, culminating in the implementation of a templated binary search-tree class. The basic example used throughout the book is that of a set of classes implementing a Numeric Series. This works fairly well.

Due to the compact nature of this book it is not what I would call thorough. For instance, the "nothrow new" is mentioned in a footnote only (though that mention is in the index, so it could be worse). Also in the chapter on exceptions, no mention is made of the quite important fact that when you inherit from the exception hierarchy provided by the standard library, you must match the throw-specification of the inherited class, which for instance means that you must declare the destructor and other member functions as non-throwing if you use std::string in your exception class (which could be argued to be "dangerous", but let's not go there).

Of the 270 pages that compose the book, the last seventy is solutions to exercises and the index. I think it is fair to say that working the exercises is a big part of reading this book. There's really only thirty or so of them, but they take up a fair amount of the book. Assuming you've read a relatively advanced beginners book such as Accelerated C++, I don't think it makes much sense to buy this one unless you're set on working the exercises.

The reason I have this book is because it came bundled in a boxed set called the C++ In-depth Series. While the books could be bought separately, the cost of this package including this book was lower than simply getting the rest of the books separately, so I was basically getting it for "free".

Essential C++ represents a compressed version of the same authors C++ Primer, if I understand it correctly. If you're a beginner I'd say Accelerated C++ is the more important book to get, but Essential C++ can be a good springboard after that, but before you move on the the more advanced titles.

(This book is part of the C++ In-depth Series, edited by Bjarne Stroustrup)

 

Accelerated C++

Practical Programming by Example

By Andrew Koenig & Barbara E.Moo

 

(image missing) This book on Amazon

Finally! Finally a book that teach a programming language the way it's supposed to be done.

If you're buying one book, and one book only to teach yourself C++, this is the one. It does everything right; it doesn't pretend to be about C++ and then describe that C-with-the-class-keyword language which many lesser books from c-programmers trying to cash in on C++ use. It introduces one of the most important aspects of being productive in C++ - namely the STL - right from the start. It doesn't spend a whole chapter introducing all the basic data-types and their relative sizes. Not even halfway through (ch 7 of 16 total) you're learning associative containers. The authors says it best; "[This book] Starts with the most useful concepts rather than the most primitive ones", which is why the books is so refreshing.

The key word here is accelerated. It is hard for me to judge how someone who is completely new to programming would take to this book, but I think that if you're serious about learning you'll have no problems. In fact, you'll probably love it every step of the way because it'll actually feel like you're doing progress as the chapters go by. You're learning the real stuff here, not things which are only applicable to toy-problems.

The amount of information packed into some 320 pages is amazing. Do not be fooled by the low page count! In addition to the basics you'd expect; doing input/output, simple string handling, you'll also learn to write your own STL-compatible containers and functors, and how to implement reference-counted smart-pointers, etc. These are semi-advanced topics that one would not normally expect to find in a "beginners" text, but which one certainly ought to expect from now on!

When you've read it you can continue to use it as a reference. If you're just learning, you will go back and look up things as you try to implement them (how did I define a copy-constructor, when is the assignment-operator used instead? etc), and the book and appendices contains quick references for the most common operations taken on the different STL containers and an overview of the most common library functions.

In my quest to nitpick, I've detected only one minor "error" that I can remember, which is that some constructor initializer lists aren't ordered as to match the corresponding declarations (see for instance the Ref_handle and Ptr classes in section 14.2/14.3)

This book sets the standard, I'm hard pressed to see how it could be improved.

(This book is part of the C++ In-depth Series, edited by Bjarne Stroustrup)

 

Code Complete

A Practical Handbook of Software Construction

By Steve McConnell

 

Cover art: Code Complete

Some people say this, almost universally, highly regarded volume is dated and obsolete. I disagree. If it was dated and obsolete then how can we explain all the awful code that is produced year after year? It's important to understand that Code Complete tries to teach you how to be a good, no, a great developer. It does this by documenting best practices, techniques and methods that have stood the test of time. It does not teach a "one true paradigm of some design methodology or other".

As I read this book I kept notes on my bookmark about things I should mention in this review. As I look back now, I realize my reservations are puny. I mean, I could comment on the fact that he writes about implementing his own crypto and does not caution the reader that they shouldn't do that unless they are cryptographers, or at know what they're doing. I could mention that he on page 433 claims, without reservation, that a debugger will execute every statement on a single line of source, as if it were a unit. I could wonder about the omission of the generally lauded practice of writing equivalence comparisons, whenever possible, such that the left hand site isn't an lvalue.

There are other objections one could make, but seen as a whole this a great book that every programmer should have read.

As I read it I couldn't help but notice that a) we agree on so many things it isn't funny, even style issues, and b) between the lines this book sings the gospel of pair programming.

If you've read this far and still don't understand what this book is about, then pay attention now; It's about Software Quality. It's about everything which affects Software Quality, from how you comment your code (don't worry, he'll mention your style too) to the temperature in your room as you code.

That's it. If you haven't read it, do so now. One must be mighty arrogant to claim that reading this volume is a waste of time.

I've once worked with a "programmer" who I wish I could have given this book to read with the instructions that he was forbidden from producing a single line of code until such time he had.

 

Programming Linux Games

By John R. Hall

 

(image missing) This book on Amazon

A book which goes through the implementation of a rather simple 2D game using SDL under linux. This is the kind of book that will get rather dated rather fast. The SDL will evolve, and some of the technologies mentioned, such as the framebuffer console, feels dated already. I liked the book in the beginning, the first three chapters or so. These chapters are used to introduce the different tools you have available to you under linux, such as gdb, make and CVS, and also a quick overview of available sound and graphics libraries. Good down to the basics stuff that you should know. Then in chapter four they get into SDL and start coding. It's okay, but this is beginners stuff for sure. 'C' is the language of choice by the way.

It started to feel like it was getting out of hand when they introduced OSS and ALSA and OpenAL for doing sound. Overall the problem with the book, which is only some 400 pages, is a sort of lack of focus. They should just had gone with one or two sound APIs (ALSA and OpenAL as far as I'm concerned) and focused on that. They choose to use TCL for scripting which I think was a really bad move. I would have gone with Lua probably, a solution which wasn't mentioned, even though it's a very popular choice in game programming circles.

There are some funny remarks in the book, I especially liked the one about professional graphics artists almost always being able to produce better artwork than programmers.

To summarize, I think this book is worth reading -- for free -- if you're a beginner, but you should know that the code and game as presented is not the result of any great design. For instance, there's a lot of code repeats (error handling) which should have been hidden away, and a chapter on writing a resource manager would have been a worthy addition, though even more so if the language of choice was C++ instead of C.

The author does acknowledge some of the faults in Chapter 9, in a section called 'In Retrospect', so at least he is honest about it, which is good. I know writing can be painful, especially if you have a deadline looming. With a little more planning and critical review this could have become a much better book, but there are not a whole lot of these books on the market so we can't be too picky. This fact is the reason this book is worth four days of your reading time, and also why it isn't as polished as it should have been.

If you're wondering about game development and can't break the problem down and go beyond the one-big-black-box-which-just-works level, then read this book and see the different pieces and how they fit together. If you're an accomplished programmer already, looking for advice on higher level design of large codebases with an eye to games specifically, then this isn't the book for you -- which is made clear in the introduction.

This one was recently released in source form. There are mirrors around so search if the link is dead. You'll find a pre-built PDF version in the ./source/release directory.

 

Multiagent Systems

A Modern Approach to Distributed Artificial Intelligence

By Gerhard Weiss

 

Cover art: Multiagent Systems

I shant try to define what an agent is here, I feel there is an intrinsic meaning most people (in CS) get. Indeed, quite a few pages of this book are spent trying to lasso the One True definition.

As an aside, my own interest in agents come from my fascination with games. I hold the belief that autonomous agents, not necessarily intelligent, will be widely used in future games. I don't think we are there yet -- though of course I cannot presume to know of everything out there -- because from what I do know, today's "AI" is tightly coupled to the environment. No proper encapsulation, therefore no proper autonomy. But I digress.

The book. Yes, I found it quite interesting for a first read on this topic outside of papers. A total of 22 authors have worked on the different chapters, so you cannot really expect a common writing style or stylistic theme. Indeed, this is more of a textbook than anything else. Not that I was expecting anything else.

The book of course discuss the basic models which are frequently used, such as the simple Belief-Desire-Intention (BDI) architecture and the highly interesting subsumption architecture of Brooks (I can strongly recommend his papers. Try Intelligence Without Reason and Intelligence Without Represenation for starters)

Then follows introductions to planning, decision making/negotition, cooperation, learning, and everything else that goes into building autonomous intelligent agents.

I must confess that later chapters, heavy in first order predicate logit, went a bit over my head. However, you must expect some degree of resistance in any worthwhile venture. I still got a lot out of this book, and I'm sure I'll come back to it in the future.

If you are unsure whether this book is for you or not, I suggest you hunt down a ToC and a review or two. It is unfortunately the case that I'm not familiar enough with the subject to write a fair review.

 

The Age of Reason

By Thomas Paine

 

Cover art: The Age of Reason

"I believe in one God, and no more; and I hope for happiness beyond this life". After professing his faith of the one god -- Paine was a Deist -- he sets out to show the absurdity of christianity.

The book is made up of two parts. The first part is more general and was written in all due haste, brought to completition in a period where Paine, living in France during the revolution, feared for his life. Having escaped death, he went back to complete his work with the second part, which is a much more detailed and systematic analysis of the faults of the testaments and christianity.

Not even 200 pages long this book, which is freely available on the internet, is a worthwhile read even if you are already familiar with most of the critique, since the historic setting it was written in colors it, making it feel exiting and interesting even now.

 

Emergence

From chaos to order

By John H. Holland

 

Cover art: Emergence

As you well know, John Holland is the discoverer of the Genetic Algorithm, and together with his student David Goldberg, might well be the most know researcher of the evolutionary computing field.

Unfortunately, a brilliant mind does not a brilliant writer make. I'm genuinely interested in the topic of emergence, but for the most part I found the book to be somewhat boring. I probably got something back from reading it, but apart from learning about the existance of Samuel's checkers playing program, I cannot tell what it was!

I get the feeling that I might as well have gone straight for the scientific papers instead. If I had to say anything nice it would be that yes, the topic is very interesting, and the first couple of chapters and the last was good. Other than that? Bland.

Maybe Holland should team up with Steven Levy to re-address this topic?

 

Cryptonomicon

By Neal Stephenson

 

Cover art: Cryptonomicon

'I'm no great literary critic, but I know what I like'. When I got into this book, I was hooked. It was getting into it that took some time. I read a few pages here and there for about a half a year, until finally I got into it and usurped most of the book in a week.

This work is built up in just the way I like it. It can be divided into two largely distinct parts, which slowly get interwoven; threads taking place during WW2, where we follow a whole bunch of interesting characters (representing both allies and axis, some of which are clearly based on real persons) as they fight the cryptographic battle (which involves quite a bit of field-work), and a 'connecting' thread placed in current time, where a group of highly paranoid guys are working to set up a data haven in Asia.

An overall good read, but I think that maybe it takes a few pages to many to get up to speed, and the ending wasn't all that stellar.

I won't say more about the story or characters, it much more fun to discover them by yourself. At some 900 pages it's a good travelling companion for anyone interested in a novel about practical cryptography and conspiracies of silence.

 

©2002 Eddy L O Jansson. All rights reserved. All trademarks acknowledged.