Journal Articles

CVu Journal Vol 17, #3 - Jun 2005 + Journal Editorial
Browse in : All > Journals > CVu > 173 (15)
All > Journal Columns > Editorial (221)
Any of these categories - All of these categories

Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xt and user-summary-[publicationtype].xt. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles . The templates will get the extension .xt there.

Title: Editorial

Author: Administrator

Date: 09 June 2005 05:00:00 +01:00 or Thu, 09 June 2005 05:00:00 +01:00

Summary: 

Body: 

A great deal has happened since last I wrote an editorial. We've had our annual conference (more of which later), I've finally had my stomach operation, we have a new production editor, a new person taking care of the Student Code Competition and lots of progress on the ACCU website. Things really are moving along!

Other things haven't moved on very much. We've (in the UK) had an election, litigation in the IBM/SCO, Novell/SCO and RedHat/SCO case are going slightly faster than an asthmatic ant carrying some heavy shopping up a hill and books with fundamental mistakes are still being published despite such piffling little things like the 1998 C++ standard coming in.

Coding Styles in Books

Something is eating at me and I'm pretty sure that it's nibbled at you all at some point and that is the plague of fundamental mistakes made in modern texts. I've been recently reading a 2004 book for Maths and Physics in Computer and Video Games programming. Partly out of interest, but mostly as I teach it and despite the book being very well presented and written, it is let down with the likes of code like this:

/* purpose: to calculate the distance between two points
// input:  P1 - an array of two floats representing point 1
//         P2 - an array of two floats representing point 2
// output: the distance between the two points

float distance2D(float *P1, float *P2)
{
  // calculate the distance and return it
  return (float)sqrt(pow(P2[0] - P1[0]), 2) + 
pow(P2[1] - P1[1], 2);
}

Okay, there doesn't really seem to be too much wrong there - in fact, there is nothing wrong with it. Not until you consider that the language in use is C++, so the casting method for the float is incorrect and I'm at a loss to see why float is being used over double.

Am I being too fussy over the cast of float or the use of floats over double? Well, no. Casting in C++ in very much different to C and for a modern compiler, there is no benefit of using a float over a double, infact, there are some very good arguments (albeit old ones) for using a double in preference to float.

This continues throughout the book. Sure, it's not really a big issue to those who know what they're talking about and do the mental changes so they are reading what should have been written rather than what has actually been written, but for the newbie, this sort of information is setting them up for quite a fall later on.

Slightly later on in the book, there is a small piece on converting from degrees to radians. It's well explained then the following is given to enable conversions:

#define RadToDeg 57.29577951f
#define DegToRad 0.017453293f

Had this been a C book, I'd have accepted it. However in C++ these should really be:

const double RadToDeg = 
    57.29577951;
const double DegToRad = 
    0.017453293;

These simple errors detract greatly from a very good book. Until you hit the CD.

Why do companies insist on putting CDs in books which detract from the book itself?

The worst example of this comes from a book I reviewed a while back called "Linux Games Programming" where it contained (in the words of the Hitch Hiker's Guide to the Galaxy) "much that was apocryphal if not wildly inaccurate" - material which just wouldn't compile, missing libraries from code examples and code which just didn't belong on the disc!

For this particular book, I was encouraged to see multiple references to OpenGL - which is great for everyone as it means all of the examples can be compiled on a multitude of platforms and I can then give live demonstrations. Um. No. It is OpenGL but the code examples all have lots of Win32 bits surrounding the code and if you have little or no experience of OpenGL (or Win32 code), the examples are about as much use as a chocolate teapot. Do I spend the time hacking things around to get the code to compile on any of my Linux boxes or do I write fresh code to do the same as the example code, become more proficient in OpenGL coding but at the same waste time I don't really have in order to use the demonstration code? Answers on a postcard.

I find it unsatisfactory (to say the least) that in 2005 we are still being subjected to books with this type of mistake and oversight in them. At least in the case of this particular book, the publishers are more than happy to pass on comments to the author for the next edition.

Desert Island Books

It seems that competitions are all the thing at the moment. In the last edition, we had the competition results in Francis' Scribbles for the Desert Island books. It was quite interesting to see what books people would have on their mythical desert island.

I'd like to run 2 similar competitions (with a similar prize).

The first would be simple. Any 5 books which you would send your teenager off to university with (they can be studying any programming course and is not restricted to conventional "computer studies" courses). They are supplied with a Mini Mac, flat screen monitor (solar powered) with gcc 4. That should make it far more interesting!

The second would be more interesting. Any 5 books which should be buried in quicklime.

Why would the second one be more interesting than the first? Interesting question.

We all know the good books (typically the ones our reviewers give Highly Recommended ratings to!) and would be happy to be seen with them. However, as we amass books, it is inevitable that we pick up a real turkey with more howlers than you'd find in a pack of wolves. These are the books that if you were not so embarrassed to have to admit to buying in the first place, you'd have taken it back and demanded not only a refund, but probably a couple of books to make up for the mental stress and anguish it placed you under. Everyone has them.

What was your crime for this to befall you? What was so awful that you are condemmed to this? I don't know. It must have been something terrible. To make it worse, you've been supplied with a ZX Spectrum using HiSoft "C" and a crummy black and white TV (only usable on UHF 36) and a tape recorded with 1 C60 and which has to be run off batteries.

Best entries will win a prize. Only genuine books though...

On With The Show...

That's enough of my ramblings. On with the show!

Notes: 

More fields may be available via dynamicdata ..