Kuro5hin.org: technology and culture, from the trenches
create account | help/FAQ | contact | links | search | IRC | site news
[ Everything | Diaries | Technology | Science | Culture | Politics | Media | News | Internet | Op-Ed | Fiction | Meta | MLP ]
We need your support: buy an ad | premium membership

[P]
Bookreview: Expert C Programming

By henrik in Culture
Wed Mar 08, 2000 at 07:28:33 PM EST
Tags: Books (all tags)
Books

Expert C Programming, by Peter van der Linden is a different book on the C language, In an easy, humorous writing style the author presents one of the most enjoyable books i've read in a long time, full of humor, stories from the world of computing and good advice.


Expert C Programming - Deep C Secrets
by Peter van der Linden

Expert C Programming - Deep C Secrets (complete with a fish on the cover) is one of the most enjoyable books i've read in a long time, full of humor, stories from the world of computing and good advice. It's written for the programmer who knows what he's doing, but you don't have to be a C wizard to get something out of this book. Expert C programming offers a humorous and vivid look at C - van der Linden explains (among other things) the difference between arrays and pointers, why programmers cant tell Halloween from Christmas day and how to make oobleck. The book offers a variety of topics that are poorly covered in other books, the material is the kind that's stenciled down in the margins of good professors books, or only found in the heads of gurus.

So if you'd like to know...

  • how to unscramble things like char * const *(*next)();
  • why extern char *a doesn't match char a[10] in another file
  • how to write a basic interpreter in 25 lines of C.
.. this book is for you.
Each chapter includes a "light relief" section, where van der Linden tells some amusing and thoughtwordy story. Like this (shortened) one:

Some Light Relief - The implementation defined effect of pragmas...

When the ANSI C standard was under development, the pragma directive was introduced. #pragma is used to convey hints to the compiler, such as the wish to expand a certain function inline. Not previously seen in C, pragma met with some initial resistance from a gcc implementator, who took the "implementation defined" effect very literally- in gcc version 1.34 the use of pragma causes the compiler to stop compiling and launch a game instead! The gcc manual contained the following:
The "#pragma" command is specified in the ANSI standard to have an arbitrary implementation defined effect. In the GNU C Preprocessor, "#pragma" first attempts to run "rouge", if that failed, gcc tries "hack". As a last resort, it launches gnu emacs displaying the towers of hanoi. If that also fails, it reports a fatal error. - manual for version 1.34 of the GNU C compiler
[ code implementating #pragma is then given.. ]

The one thing you notice is how enthusiastic the author is about programming. He clearly loves writing code, and it shows in the book.

At the end of the book, there is a great "secrets of programmer job interviews" appendix (it alone is worth the price of the book). In there he asks you some fairly challenging questions: Like this favorite microsoft question: Pick a random line from a file, all lines having an equal chance of being selected. The problem is that you only get to do one sequential pass though the file. Know how to do it? :)

What's bad? Not much. It could have been a little less focused on C, but it is a C book after all - and while C programmers will get the most out of Expert C Programming, any geek can enjoy it - for the fun anectocts if nothing else.

A lot of people on ./ seem to like the TOC, so here it is:

  1. C through the mists of time
  2. It's not a bug, It's a language feature
  3. Unscrambling declarations in C
  4. The shocking truth: C arrays and pointers are NOT the same
  5. Thinking of linking
  6. Poetry in motion: Runtime data structures
  7. Thanks for the memory
  8. Why programmers cant tell halloween from christmas day
  9. More about arrays
  10. More about pointers
  11. You know C, so C++ is easy
  12. Appendix: Secrets of job programmer interviews


Bathroom factor: 8/10 (you can flip to any page, and just start reading - the only reason it doesn't get a 9 is that your bathroom visits may become prolonged, annoying other family members)
Overall: Highly recommended (if you're proficient in C, buy it!)

Side note - this is my first attempt at doing a book review - if something sucks, tell me about it, and what i should do differently. (and don't be afraid to vote -1 on this story, if you want me to change something before posting it to the main page)

Sponsors

Voxel dot net
o Managed Hosting
o VoxCAST Content Delivery
o Raw Infrastructure

Login

Related Links
o Also by henrik


Display: Sort:
Bookreview: Expert C Programming | 14 comments (14 topical, editorial, 0 hidden)
Ooblek? Is that the corn starch / w... (none / 0) (#1)
by rusty on Wed Mar 08, 2000 at 05:20:45 PM EST

rusty voted 1 on this story.

Ooblek? Is that the corn starch / water non-newtonian fluid?

Great review. Hope to see many more of these :-)

____
Not the real rusty

Re: Ooblek? Is that the corn starch / w... (none / 0) (#3)
by henrik on Wed Mar 08, 2000 at 07:37:44 PM EST

yep - that's the stuff.

How to make oobleck in three easy steps:
1) take one cup of cornstarch
2) add some food coloring (preferably green)
3) slowly knead up in up to half a cup of water.

Enjoy :)


Akademiska Intresseklubben antecknar!
[ Parent ]
Well, I can't bring myself to vote ... (none / 0) (#2)
by Paul Dunne on Wed Mar 08, 2000 at 06:38:13 PM EST

Paul Dunne voted 0 on this story.

Well, I can't bring myself to vote -1 as you asked, but... it's a good review as far as it goes, but why so short? Write more! It sounds like a good book.
http://dunne.home.dhs.org/

Re: Well, I can't bring myself to vote ... (none / 0) (#10)
by henrik on Thu Mar 09, 2000 at 06:32:56 AM EST

Point taken :)

the next one (if rusty dosn't let me off the hook) will contain more meat .. and will menton the ISBN Number (0-13-177429-8), and the number of pages (350), and the publisher (Prentice Hall).. :)

went to your page - you're a "real" writer! :) . Any other tips you feel like disclosing to a fellow amateur (heck - i'm not even a native english speaker) ?

-henrik



Akademiska Intresseklubben antecknar!
[ Parent ]
So, what's the Answer?!! (none / 0) (#4)
by torpor on Wed Mar 08, 2000 at 08:21:45 PM EST

To the favourite Microsoft question, then ... c'mon, don't leave me hanging in suspense!
j. -- boink! i have no sig!
Here's my guess (4.00 / 1) (#6)
by Imperator on Wed Mar 08, 2000 at 09:58:59 PM EST

(Yes, I know this isn't C, but you get the idea.)

$lines = 1; # number read so far
$picked = ""; # currently selected line
while (defined($line = <FILE>)) {
if (rand($lines) > ($lines -1)) {
$picked = $line;
}
$lines++;
}

Something like that. I haven't really thought it out. :)

[ Parent ]
Re: Here's my guess (none / 0) (#8)
by fvw on Thu Mar 09, 2000 at 12:12:07 AM EST

Hmm, I prefer my solution where you just load it all into a gigantic array. ;-)

[ Parent ]
Re: Here's my guess (none / 0) (#12)
by superfly on Thu Mar 09, 2000 at 08:02:32 PM EST

The Perl Cookbook has a super-compact form of this.

rand($.) < 1 && ($line = $_) while <>;

$line is the random line. If you're using a Perl older than 5.004, you should call srand() first. $. is the current line number, by the way.



[ Parent ]
Ah, should have looked in the Ram in the first pla (none / 0) (#13)
by Imperator on Thu Mar 09, 2000 at 11:17:54 PM EST

The discussion of that recipe gave me some confidence in the code I wasn't totally sure was correct. :)

[ Parent ]
Re: So, what's the Answer?!! (none / 0) (#11)
by ironside on Thu Mar 09, 2000 at 07:27:39 AM EST

I did this for a hangman program I wrote recently. What I did was to seek to a random char in the file and then use the next line. High hack value, never selects the first line, and lines after a long line pop up more often.
But wtf, it's random enough :)

[ Parent ]
Also, what is the ISBN #? (3.00 / 1) (#5)
by torpor on Wed Mar 08, 2000 at 08:23:39 PM EST

My only remark on your review is that you didn't provide enough details for me to be able to easily go buy the book at Amazon ... got an ISBN #, or a link? Yeah, I know I could just type in the title, but ...
j. -- boink! i have no sig!
Re: Also, what is the ISBN #? (none / 0) (#7)
by Emilio on Wed Mar 08, 2000 at 10:38:55 PM EST

ISBN: 0131774298

Buy it at Amazon.com

Although, it is cheapest at BookPool ($30.95 instead of $39.99)

I found that out at http://www.snmputils.com/booksearch/ for those who are interested.



Finally, I have read the book and I must say that I really did enjoy it. Even though I don't program C anymore (I'm more into python and perl) I would still like to read it again if I could get ahold of it.

[ Parent ]
Re: Also, what is the ISBN #? (none / 0) (#9)
by fluffy grue on Thu Mar 09, 2000 at 12:43:02 AM EST

No, not at Amazon. Even if recent blessings by Tim O'Reilly make the patents not seem like an issue, they do other stuff I don't agree with; for example, a friend of mine was fired for being a pagan, which they covered up with some nice bullshit and turned it into "gross misconduct" so she didn't even get severance pay.
--
"Is not a quine" is not a quine.
I have a master's degree in science!

[ Hug Your Trikuare ]
[ Parent ]

Re: Bookreview: Expert C Programming (none / 0) (#14)
by Anonymous Hero on Fri Mar 10, 2000 at 11:30:39 AM EST

If it has a fish on the cover, I have to buy it!

Furry Fish.

Bookreview: Expert C Programming | 14 comments (14 topical, 0 editorial, 0 hidden)
Display: Sort:

kuro5hin.org

[XML]
All trademarks and copyrights on this page are owned by their respective companies. The Rest 2000 - Present Kuro5hin.org Inc.
See our legalese page for copyright policies. Please also read our Privacy Policy.
Kuro5hin.org is powered by Free Software, including Apache, Perl, and Linux, The Scoop Engine that runs this site is freely available, under the terms of the GPL.
Need some help? Email help@kuro5hin.org.
My heart's the long stairs.

Powered by Scoop create account | help/FAQ | mission | links | search | IRC | YOU choose the stories!