REVIEW - C & Data Structures


Title:

C & Data Structures

Author:

P. S. Deshpande, O. G. Kakde

ISBN:

Publisher:

Charles River Media (2004)

Pages:

700pp

Reviewer:

Francis Glassborow

Reviewed:

December 2005

Rating:

★★☆☆☆


This is one of those books where the authors want to write about implementing data structures (probably because it is a nice well-defined topic found in most university computer science curricula) but decide that they first have to introduce the reader to programming in C. These are two entirely different topics. If you can already program in C you would not want the first 163 pages, and if you cannot then the first 163 pages are almost certainly not enough (even if they were high quality).

Let me address that last comment by showing you a couple of pieces of code (chosen more or less at random from the first part of the book. I promise that even I did not realise how bad it was till I started copying it. Originally it was only such things as the use of 'class' as a variable name - producing an unnecessary incompatibility with C++ - and the loss of several semi-colons.).

On page 139 the author provides the following code:

struct address \\ A {   plot char [30], struc char[30];   city char[30] } struct student \\ B {   name char[30];   marks float;   struct address adr; } main ( ) {   struct student student1; \\D   struct student class[20]; \\E   class[1].marks = 70; // F    /* remainder suppressed but it is     just a hard coded initialisation     of class[1] followed by five     printf() statements to output the     contents of class[1] to stdout./*
There then follows a section explaining the code. The first item is: 1.Statement A declares the address of a structure containing the members plot, street and city. I think that that 'explanation' demonstrates beyond doubt that at least some of the errors in the code are the author's direct fault. This book takes the concept of typos to a new height, indeed, assuming the authors can actually program in C and test their code, I cannot imagine how some of the errors occurred during the process of typesetting the book.

I am sometimes willing to be a little forgiving of authors who insist on writing

void main() {
, but that is the least of the problems with this book. The only use I can think of for this book is as a source of practice material for code reviews. Even with all the typos and errors removed this book still uses a style of C coding that would be a disaster in any modern development environment. I would recommend that this book be withdrawn and never published as a second edition. There are already numerous considerably better (though not perfect) books on data structures.

I have tried to find out something about the authors but the book provides no information and I have failed to find any elsewhere. They do acknowledge help from a computer science graduate from IIT Mumbai and from two of their own students. My feeling is that the code looks like student code, so perhaps it is literally their student's code without any correction.

Please could publishers stop wasting trees with this kind of book, quite apart from the waste of paper, readers will learn a dangerous style of programming in C.


Book cover image courtesy of Open Library.





Your Privacy

By clicking "Accept Non-Essential Cookies" you agree ACCU can store non-essential cookies on your device and disclose information in accordance with our Privacy Policy and Cookie Policy.

Current Setting: Non-Essential Cookies REJECTED


By clicking "Include Third Party Content" you agree ACCU can forward your IP address to third-party sites (such as YouTube) to enhance the information presented on this site, and that third-party sites may store cookies on your device.

Current Setting: Third Party Content EXCLUDED



Settings can be changed at any time from the Cookie Policy page.