Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
News Books Media Book Reviews

Review:Linux Application Development

Slashdot reader (and now reviewer) Mark Pruett sent us a book that has pretty critical importance, Linux Application Development . If we are really to win the world over, we must have more and more applications. That, and write them well. If you want to do that, read below.
Linux Application Development
author Michael K. Johnson and Eric W. Troan
pages
publisher Addison-Wesley
rating 9/10
reviewer Mark Pruett
ISBN 0-201-30821-5
summary

A clear, concise, practical book for C programmers trying to grasp the nuances of the Linux operating system.

Linux Application Development is one of the few 500+ page computer books published today that deserves its length. It was written by Michael K. Johnson and Eric W. Troan, two names that some SlashDot readers may recognize. These guys are developers for Red Hat Software.

This book fills the need for a concise, clear, no-nonsense book on how to write C programs that run well in the Linux environment. It is short on history and devoid of political diatribe.

Who Needs This Book?

This book is aimed at experienced programmers. It most definitely won't teach you how to program. But programmers moving from another operating system (other Unix variants or any Microsoft platform) will get a big boost up the learning curve.

Having come to Linux almost four years ago after a decade or so as a DOS/Windows programmer, I know this book can be invaluable. Linux (and Unix in general) is a different mindset than Microsoft Windows, and while this book spends no time directly comparing the two operating systems, it does provide the map a Windows programmer needs to make the transition.

The book is broken into four sections. Getting Started provides a brief history of Linux, an overview of the different free software licenses, an explanation of Linux documentation, and pointers to Linux information on the internet.

The second section covers Development Tools and Environment. Make no mistake: this is a book for C programmers. There's information here on the GNU gcc compiler, on vi and Emacs, on Make, on the GNU Debugger, and on memory debugging tools like Checker and Electric Fence. A highlight of this section is the chapter Creating and Using Libraries; this contains information especially useful to programmers new to the Linux OS.

Most of the information in this second section is not in-depth. Rather, it lets you know these tools exist. You'll need to find other references in order to master them.

Systems Programming in Linux

The third section, System Programming, provides the real meat of the book. It features chapters on the Process Model, Simple and Advanced File Handling, Directory Operations, Signal Processing, Job Control, Sockets, and a lot more.

You can tell these guys write code for a living. Their example programs are practical, and serve as good illustrations the topic they're covering. Their explanations are clear and precise; they don't waste your time.

For example, here's their explanation of the getservbyname() function:

Linux systems include the file /etc/services, which maps protocols to port numbers. The most common way to access this file is through the getservbyname() function, which returns information on a particular service.

#include <netdb.h>

struct servent * getservbyname(const char * name,
const char * protocol);
The first parameter, name, is the service name about which the application needs information. The protocol parameter specifies the protocol that will be used. The services database contains information on other protocols (especially UDP); specifying the protocol allows the function to ignore information on other protocols. The protocol is usually the string "tcp", though other protocol names, such as "udp", may be used.

I read arguments in the discussion that followed Arjen Laarhoven's review of Stevens' Advanced Programming in the Unix environment to the effect that the unix man pages are all that a programmer might want or need. I'll leave it as an exercise for the reader to compare the passage above with "man getservbyname". The latter tells you the how, the former tells you the why and the what.

This third section alone is, in my opinion, worth the price of the book.

The final section of the book covers Development Libraries. This section covers a collection of useful libraries, covering topics such as string matching with regular expressions, parsing command line options, and the db database library.

What They Left Out

The authors left out virtually any talk of graphics or X programming. In some ways, this is a good thing, and may extend the shelf-life of the book. The world of X windows and Linux is a bit fractured at the moment, with competing libraries jockeying for position. The authors could have avoided this by discussing X at a lower level (Xlib and the X Intrinsics), but there are other books that do this well enough. [A very good book for programmers interested in learning X is The X Toolkit Cookbook by Paul Kimball, ISBN 0-13-973132-6.]

The authors didn't discuss other languages popular in the Linux environment, such as Perl and Python. Again, I think this would have diluted the book. As it is, Johnson and Troan maintain a sharp focus on what's important to C programmers using Linux.

Compares Favorably

In style and in utility, this book reminds me of Richard Stevens' Unix books, particularly his great Advanced Programming in the Unix Environment (they even share the same publisher). There is some overlap between material in the Stevens' books and material in Linux Application Development. My inclination would be to read the section in LAD first, and then, if the subject was still unclear, look to the Stevens' books for more depth.

If you're a Linux developer, or if you're a C programmer thinking of diving into Linux, I can recommend this book without reservation.

Mark Pruett

To get this book, check out this spot brought by Amazon.

This discussion has been archived. No new comments can be posted.

Review:Linux Application Development

Comments Filter:

What is wanted is not the will to believe, but the will to find out, which is the exact opposite. -- Bertrand Russell, "Skeptical Essays", 1928

Working...