Slashdot Mirror


Review:Beginning Linux Programming

Kurt Gray sent a review of Beginning Linux Programming, by Neil Matthew & Richard Stones. Click here to learn how to contribute more code. Beginning Linux Programming author Neil Matthew & Richard Stones pages 710 publisher Wrox Press rating 8/10 reviewer Kurt Gray ISBN summary A fair time worthy of your UNIX programming virginity.

Hark Ye Newbies, the Clue Phone Ringeth!


The trees felled to print this book died for a worthy cause: to entice more programmers to hang out at Camp Linux, especially newbie programmers. Our two friendly co-authors, their three editors, and a small army of technical reviewers and other hangers-on, will gently take your quivering little hand and whisk you away into the enchanted forests of shell programming, curses, terminals, file I/O, pipes, sockets, shared memory, DBM files, Tcl, Tk, HTML, CGI, gdb debugging, and some other crazy places that would scare your Mom if she ever found out. The descriptions of each topic are clear and almost every page includes a tasty morsel of sample code, constantly assuring that reader that even drooling idiots like you can write real-world UNIX applications in short time.

Dropping the "L" Word:


Fortunately the content is not biased toward any particular distribution of Linux, but in fact it's not particularly biased toward Linux either. I am hard-pressed to find any part of the book that can not be applied to UNIX in general, so I think a more appropriate title for this book would be "Beginning UNIX Programming", but I suppose the drawbacks of doing so would mean 1) whining tech journalists would complain of the lack of Linux programming books because they didn't bother searching under "UNIX programming", and 2) Linux is a flavor of UNIX anyway so you may well teach newbie programmers the UNIX way of doing things.

Perspective:


What I'm reading here is the actually the third printing of this book, circa 1997, (first printing in 1996) and many things have happened in Linux development since then so unfortunately there's no mention of GIMP, GNOME, Gtk, KDE, Qt, MySQL, Mesa, WindowMaker, and other areas that currently hold the interest of so many Linux hackers. And true, perhaps these topics too advanced for a book called "Beginning Linux Programming" but the book does attempt to touch upon all aspects of Linux programming so why not say a little bit about the APIs that are hosting the coolest parties.

What's Good:
  • Very comprehensive. It would be hard to read this book and still be confused about UNIX architecture.
  • Clear examples. Unlike so many programming books where the example code spools on and on for pages, the examples in this book are divided into easily digestible bite sized code snippets, separated by block of text to explain what's going on every step of the way.
  • Quick guides to common tools: This book explains the simple yet non obvious commands every UNIX programmer has become familiar with: gcc, make (and Makefiles), gdb, patch, diff, tar, cflow, cxref, indent, lclint, etc. It takes care of most of the questions you'll find posted in comp.os.unix.programming newsgroups.
  • Bonuses: It seems to me the authors did not have to discuss topics such as using DBM databases, HTML authoring, and CGI programming in this book, but they do so anyway which makes it all the more harder to keep this book out of arm's reach.


What's Bad:
  • PERL, anyone? There's a whole chapter devoted to Tcl and yet only 2 pages devoted to a little something, maybe you've heard of this thing, called "perl"?!
  • Open Source, anyone? Fails to reiterate the most valuable asset of Linux which pertains to programmers: it's (almost) entirely Open Source. The code is all there right under your nose! Feel free to browse through it and tell the developers what you think. And sure you could spend many weeks writing your own special application but chances are someone out there has already started an Open Source project to develop exactly what you need. That's what set's Linux apart from so many other flavors of UNIX is the prevailing code license: "GNU's not UNIX!".
  • A little bit dated: Since its current printing is from 1997, there's no mention of the newer APIs common in Linux these days (GNOME, KDE, etc. etc.).
  • Guilty of declaring fixed-size string buffers: Most of the C code examples reinforce bad habits such as feeding external data directly into fixed-length character buffers. Some examples should have titled "How to Make A Core Dump File". I don't think you can say enough to persuade C programmers to consider the stability and security of their applications. You may accuse me of nit-picking here, but I thinks its best to teach programmers while they're young so to save them a major rewrite later on.
Overall: It's a keeper. I think even the seasoned UNIX programmer would find it useful due to the variety of topics covered therein. Handy for answering the simple questions like "How I read/write to a DBM file again?" This copy is staying in my office bookshelf.

Pick this book up at Amazon.

Table of Contents:

Chapter 1: Getting Started

What is UNIX? What is Linux? GNU, Free Software Foundation, The C Compiler, C header files and libraries, UNIX philosophy

Chapter 2: Shell Programming

What is a shell? Pipes and redirection, shell as a programming language, shell syntax, example app: audio CD collection cataloger

Chapter 3: Working with Files

UNIX file structure, System Calls and Device Drivers, Library Functions, Low-level file access, Standard I/O library (in C), File and Directory Maintenance, Scanning Directories, Errors, Advanced Topics (file descriptors and memory mapped I/O)

Chapter 4: The UNIX Environment

Program arguments, Environment variables, Time and Date, Temp files, Host information, Logging, Resources and Limits

Chapter 5: Terminals

Reading and writing to the terminal, the terminal driver and interface, the termios structure, terminal output, identifying the terminal type, detecting keystrokes

Chapter 6: Curses

Compiling with curses, Basic curses features, keyboard input, multiple curses windows, subwindows, the keypad, color, example app: The CD audio collection using a curses interface

Chapter 7: Data Management

Managing memory, memory allocation, the NULL pointer, lock files, deadlocks, databases (dbm), Example app: The audio CD catalog using dbm

Chapter 8: Development Tools

The make command and Makefiles, Source code control (RCS, SCSS), writing man pages, making patches and tar files

Chapter 9: Debugging (C code)

Types of errors, code inspection, using gdb, more debugging tools (ctags, cxref, cflow, prof, gprof, lint) Assertions, Memory Debugging (ElectricFence, purify, Checker)

Chapter 10: Processes and Signals

Process structure, viewing processes, system processes, process scheduling, waiting for a process, input and output redirection, threads, signals, signal sets.

Chapter 11: Interprocess Communication: Pipes

Process types, Sending output to popen, the pipe call, parent and child processes, reading closed pipes, pipes used as standard input and output, named pipes: FIFOs, Example: the CD catalog as a client/server application

Chapter 12: Semaphores, Message Queues, and Shared Memory

Semaphores, UNIX semaphore facilities, shared memory, message queues, queue efficiency, IPC status commands

Chapter 13: Sockets

Socket connections, socket addresses, host and network byte ordering, Network information, the Internet daemon, socket options, Multiple clients, the select() function

Chapter 14: Tcl: Tool Command Language

"Hello World" in Tcl, Tcl commands, calculations, substitutions, error handling, arrays, lists, procedures, Input/Output, Tcl extensions, expect, [incr Tcl], TclX, networking, graphics, Tk, tgdb

Chapter 15: Programing for X

X server, X protocol, Xlib, X clients, X toolkits, X Window Manager, the X programming model, the Tk Toolkit, windows programming, configuration files, Tk widgets, geometry management, inter-application communication, Example app: a bitmap display program in Tk, Java, X programming with Java

Chapter 16: Programming for the Internet: HTML

What is the World Wide Web, writing HTML, HTML tags, HTML tables, HTML hyperlinks, serving HTML pages (Apache), Server-side Includes

Chapter 17: Internet Programming 2: CGI

the FORM tag, the INPUT tag, WWW encoding, Writing a server-side CGIprogram, decoding form data, using perl as a back end to the CGI, returning HTML to the client, Tips and Tricks, Example app: the CD catalog online written as a CGIapp in C

Appendix A: Portability

Language portability, reserved names, hardware portability, sizes, byte order, char, union packing, structure alignment, pointer sizes, moving to C++

Appendix B: FSF and the GNUProject

The GNUproject and GNUPublic License

Appendix C: Internet Resources

Newsgroups, WWW locations, FTP archives, CD vendors, Linux specific

Appendix D: Bibliography

Standards, other documentation, other cool books not related to computers.

Index

Picture of Tux

Survey Card

Back Cover

Top Surface of My Desk

My Feet

The Carpet

Foundation of this Building

Gravel

Bedrock

Hell

Bedrock

Australia

Space...

0 of 67 comments (clear)

No comments match the current filter.