Oh, say can you C? Learning to program with Head First C – #bookreview #in #programming

Head First C
By David Griffiths and Dawn Griffiths
(O’Reilly,
paperback, list price $49.99)

 Long ago, in a universe now very far away, I was an ABC programmer: assembler, BASIC, and C. I learned C from a book popularly known as “K&R,” after its authors, Brian W. Kernighan and Dennis M. Ritchie. (Their classic work is now available in an updated second edition.)

But I had no mentors, so I struggled to figure out and apply many of the basic concepts that were not quite spelled out clearly enough or illustrated well enough for me in K&R.

I really wish I had had a book like Head First C, instead. My geeky logical side often is ruled and frequently overruled by my unstructured, illogical artistic side.

For learners like me, O’Reilly’s “Head First” series makes effective and entertaining use of graphics. It also addresses readers with a conversational style that avoids lecturing. And it focuses on trying to make sure you understand and can apply each new element.

Thus, Head First C does not try to be a complete C language reference guide. It shows you how to work with C’s major concepts, and you begin using them right away, so you can start understanding the process of becoming an effective C programmer. After that, if you are motivated to continue, you can push on into other books that do attempt to be complete C reference texts.

This “brain friendly guide” shows how to download free C compilers for Linux, Macintosh, and Windows machines. And, the authors assure: “All the code in this book is intended to run across all these operating systems, and we’ve tried hard not to write anything that will only work on one type of computer.”

Another positive for this book: You don’t have to key in or wade through dozens of lines of code to get to the few lines you are really supposed to be studying. “Most examples in this book are shown within the smallest possible context, so that the part you’re trying to learn is clear and simple.”

And, the book has been given a thorough technical review. So the code examples that are intended to work generally will work.

The book’s 12 chapters focus on the following topics:

  1. Getting Started with C
  2. Memory and Pointers
  3. Strings
  4. Creating Small Tools
  5. Using Multiple Source Files
  6. Structs, Unions, and Bitfields
  7. Data Structures and Dynamic Memory
  8. Advanced Functions
  9. Static and Dynamic Libraries
  10. Processes and System Calls
  11. Interprocess Communication
  12. Sockets and Networking
  13. Threads

About midway through the book, you are presented with your first lab exercise. You write some C code and hook up a few hardware components to create an Arduino-powered plant monitor that lights up an LED and repeatedly sends the string “Feed me!” to your screen if a plant needs to be watered.

In the book’s second lab exercise, you write C code that lets your computer and its web cam act as an intruder detector. You do this with help from OpenCV, “an open source computer vision library. It allows you to take input from your computer camera, process it, and analyze real-time image data and make decisions based on what your computer sees.”

In the third and final lab exercise, you use your new C skills to write a video game called “Blasteroids,” with help from the Allegro open source game development library.

Head First C is a first and foremost a very good book for beginners, especially those who have at least a little bit of programming experience. But it delves into some advanced-level topics, too, such as multithreading and network programming.

If learning C is your goal, Head First C can help you stay focused, stay entertained and happily soak up the things you need to know.

#

Si Dunn is a novelist, screenwriter, freelance book reviewer, and former software technical writer and software/hardware QA test specialist. He also is a former newspaper and magazine photojournalist. His latest book is Dark Signals, a Vietnam War memoir. He is the author of an e-book detective novel, Erwin’s Law, now also available in paperback, plus a novella, Jump, and several other books and short stories.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s