



Advanced C Programming by Example 47
Advanced C Programming by Example | |
author | John W. Perry |
pages | |
publisher | PWS |
rating | 9/10 |
reviewer | LizardKing |
ISBN | |
summary | An unusualy well written C textbook, that picks up where most other programming guides finish off. |
The Scenario
Having been given a book voucher for Christmas, I duly trotted off to Blackwell's bookshop in Oxford to see what I could spend it on. I did the obligatory check for new O'Reilly titles, before turning to the C books. A hardback copy of Kamp II to replace my dog-eared paperback would've been nice, but first I decided to flick through Advanced C Programming by Example. The contents page promised examples of pointer trickery, string manipulation and dynamic data structures. I consequently bought it.
What's Bad?
There is very little to fault this book on. It is written in a clear and enjoyable manner, which is about the best you can hope for from a programming guide. My only real criticism is the lack of a bibliography. For instance, cryptography is mentioned in the chapter on bit manipulation, but no references to further reading are given.
What's Good?
The introduction explains the rationale behind producing another C book by pointing to the dearth of intermediate level texts. The author also criticises the current emphasis on OO languages with their larger vocabulary and more abstract concepts.
The first chapter highlights the importance of coding style to aid maintainability, and the valid use of features like the ternary and comma operators. This is followed by an excellent review of pointer theory. I always judge a C book by how clearly it describes the purpose of pointers - and this one does it superbly.
Subsequent chapters contain in depth analysis of key data structures like singly and doubly linked lists, binary trees, etc. While most C books include examples of these, they are particularily well described and illustrated. Other important techniques like hashing (both to memory and disk) are introduced, with common pitfalls highlighted.
The bit manipulation chapter is comparable with those in other C texts, but is unusually clear and consistent. The same can be said of the advanced I/O chapter.
The chapter on string manipulation uses dynamic memory allocation, arrays of pointers and the more obscure ANSI C string functions for 'real world' examples. This is another area where many C books fall down, ignoring the fact that the strings many programmers deal with cannot be expected to fit into fixed length arrays.
The final "Pot-Pourri" chapters include a discussion of complex function declarations that both expect and return function pointers. A number of other rarely described but expressive features are also covered.
So What's In It For Me?
If you consider yourself a C expert, then this book may be superfluous, as it covers ideas and principles you should know intimately. But if like me you're spending more time with scripting languages like Perl, you may need a handy reference for those forays back into C.
Buy this book here.
Table of Contents
- Optimal C Coding Style
- Review of Standard Pointer and Array Operations
- The Linear Dynamic Data Structures: Stacks, Queues and Linked Lists
- Advanced String Handling
- Advanced Input and Output
- Bit Manipulation
- Recursion and Binary Trees
- Multidimensional Arrays and Arrays of (Non-Char) Pointers
- Potpourri: Part One
- Potpourri: Part Two
- Answers to Selected Exercises
C: power to the people (Score:1)
C is very much like unix: more power than you can handle, and if you burn yourself, it's your fault. I've yet to find a C problem that way not caused by bad design and/or bad implementation.
and taking care is the prize you pay for power. so if you can't handle it, then stay away from it. but stop telling me what to do. thank you.
Are we talking Pascal here... (Score:1)
I spend a lot of my spare time programming embedded systems in C...and some of it is a real grind compared to the day job programming in Delphi/Object Pascal. What language would allow this!
if ( Finished = TRUE )
{
PerhapsIllNeverGetRun();
}
It is my experience that C zealots rarely know many other languages
PICK ON C? GO TO JAIL! :) (Score:1)
Why C is not my favorite programming language (Score:1)
2) Problems are complicated (in general), and require
complicated solutions.
3) "Efficicent" [1] languages like C/C++ make the programmer
deal with complexities that are unrelated to the actual problem.
4) Hence C is not my favorite programming language.
[1] When people say "C is efficient", they are talking about
the speed of the resulting executable. OTOH 99.44% of the time,
it is much better to optimize *Programmer Efficiency*.
Perl (Score:1)
What I would really like to see is increased flexibility in the typeglob. This should be a (C style) union [typesafe
Price Check (Score:1)
AlphabetStreet (UK) $34.25
BarnesAndNoble $44.95
Dymocks (AUS) US$31.29
Spree $36.76
Regards, Ralph.
C is dumb? (Score:1)
If you think C++ is so great for things like kernal programming then look closer at why Win95 crashes so much. Did you ever notice that modules don't always load in the same sequence?
Saying that C is dumb just proves what an asenine egotist you are. You don't understand the basis of the tools you are using.
There are very good reason's why 1. kernal programming, 2. embedded systems, 3. low level devices are done in C and not C++.
Java will one day surplant C++ as the standard OO design platform and not a day too soon. When that happens, C will still be used widely for many tasks which are unsuited to Java.
If you don't understand these basic issues, then I recommend you go back to Visual Basic programming and leave the system programming to people with more brains than you have.
PICK ON C? GO TO JAIL! :) (Score:1)
Do this in C++...
Cross platform/compiler. No real standard, no real cross platorm=no real widespread usage for cross platform work.
'nuff said.
:)
-Alan
Learning C = Learning C++ (Score:1)
I use C++ and/or Java every day. You can bet I'll read this book sooner or later to make myself a better programmer in languages based on C (including Objective-C, for all you NeXT/Mac types out there).
Sokwuitcherbichin!
Calm down ... (Score:1)
book would be `Intermediate C Programming', but
your distinctly rabid sentiments are wide of the
mark.
Deep C Secrets is a book that I mean to check out
at some point, but I was a little less than
enamoured with van der Linden's `Just Java' book.
It offers a lot of very good insights into Java,
but is lacking in example code.
As an aside, the classic view that C can *only* be
learnt from KnR II is a little suspect. It is
a great introductory text, and an even better
reference for C syntax, but it is a little too
bare bones for a standalone C tutorial.
C is dumb (Score:1)
C++ means "C grows larger, but result is as before". If Stroustroup had really intended
to build general replacement for C, not a language
which works better than C in _particular_ areas,
he'd call it ++C
I rather would judge by products written on it. (Score:1)
apache - is written on C
Emacs - written on Lisp (so its way for OO programs)
Linux kernel - written on C
Gimp - written on C.
Perl - written on C
Tcl - written on C
So, where are good programs written on C++?
Nothing to name except KDE. But there is a lot
of problems with it. Is there web-servers war?
No - anyone prefer to contribute to apache.
But there is Desktop war, becouse too much people
don't like either Qt or C++ at all and starting
altertaitve desktop projects.
Consider number of programmers who would be
able to peer review and contribute to your code.
If you write in C every C _and_ C++ programmer
counts. If you write in C++, there are a lot
of people (and, more imprtant, compiliers)
who wouldn't understand what are you trying to
say.
Also, expert C programming (Score:1)
People might like to check out Van Der Linden's "Expert C Programming (Deep C Secrets)" - it's a very odd book, full of many random snippets, but it does contain some nuggets of useful wisdom.
Thanks for the review - I'll have a look for this book next time are out shopping...
Cheers,
Andrew
Can't judge a language by the people who use it (Score:1)
I mean, I know some good programmers that are forced to use VisualBasic; doesn't make visual basic any better than the horrid excuse for a scripting language that it is.
I know some poor coders who try to code in C; doesn't make C a poor language.
C is dumb (Score:1)
the title! Let's do this! (Score:1)
C is dumb? (Score:1)
Price Check (Score:1)
If you are looking for computer books look at http://www.bookpool.com. They are not indexed by acses.com, but they usually the cheapest and often out-of-stock.
Other new bookstores that seem promising:
http://www.shopping.com
http://www.buybooks.com (buycomp.com rocks!)
Never use amazon.com and barnesandnoble.com. They often lie about their selection (sure we have that in stock! oops, please wait 5 weeks)
Why buy this book? (Score:1)
And if you need the linked-list-hash-table-b-tree stuff get a good algorithms book. I have heard Sedgewick (?) has written some good ones for C and C++.
C is dumb (Score:1)
Your SOOO hip (Score:1)
"They should have a book on Shockwave instead!"
"They should have a book on JavaBeans instead!"
...whoa! If I'm ignorant and spout gay-ass buzzwords, then I'm cool! This is SOOO cool. I can't wait to tell my mom.
(Not saying C++ is bad or anything, but I am saying that straight-up C coding is a man's language.. Heheh)
C is dumb (Score:1)
Programming language is the tool or instrument only. It can't be dumb.
But programmer (usually not a real programmer) can. And don't forget that the C++ is only preprocessor for pure C... I think that mindless plastic box (even 450 MHz with) can't be smarter than man's brain...
Why C is not my favorite programming language (Score:1)
Quite frankly I LOVE C!