Slashdot Mirror


Linux Programming By Example

Craig Maloney writes "Linux Programming By Example is a book aimed squarely at programmers learning how to program the Linux and UNIX system for the first time." Read Craig's review of Linux Programming by Example (below) to find his take on whether the book delivers on the promise of its title. Linux Programming By Example author Kurt Wall pages 533 publisher QUE (InformIT) rating 9/10 reviewer Craig Maloney ISBN 0789722151 summary Linux Programming by Example is a concise and solid introduction to programming under the Linux system. Excellent instructions accompany fully-working examples of code.

There are plenty of books on this topic as any trip to the bookstore will show. Where this book excels compared with other Linux programming books is its consistent focus throughout. Other books tend to explain a multitude of concepts without relating them back to a real-world example. In Linux Programming By Example, the author introduces a concept, and explains it with an example. In the last chapter, the author integrates the knowledge he's presented, utilizing many of the book's concepts in building a simple CD-Database program. Of course, not all of the concepts relate to the final CD database (The chapters TCP/IP Programming, The Sound API and Using the Mouse are not referred to in the final program), but it's helpful for beginning programmers unsure how all of these pieces fit in the bigger picture of a working program.

Begin at the beginning

Linux Programming By Example begins with topics that don't get covered until the end of many books. The book starts by discussing how to use GCC and make on a Linux machine, and how to create a Makefile. It's always puzzled me why some books don't cover the compiler or the make process until the end of the book. What's the point in that? Granted, chapters in debugging and RCS are left to the end of the book, but presenting key concepts in the development process early in the book helps the reader to get a better feel for how all of these concepts interrelate in a Linux/UNIX environment.

Moving forward

From the basics of compilation and making programs, the book moves to the basics of a Linux system in Part II: System Programming. This is where the book truly shines. In the section on processes, Wall discusses the elements that make up a process, how to manipulate a process, and why you would want to do this anyway. The book assumes no prior UNIX knowledge, but doesn't plod along like most introductory texts. In the section on signals, the book defines what signals are, early signal APIs and their issues, POSIX and Linux signal APIs, and how to use signals and signal sets. In this chapter, the author not only lists the signals supported by the Linux system, but also other signals supported by POSIX and other UNIX systems. While this might sound confusing, the author takes time out to explain which signals are really important in a Linux environment. This is a key reason why this book retains its readability without losing depth. Each chapter in the System Programming portion of the book retains this format -- not only demonstrating what the topic is, but also where this fits in a Linux/UNIX system and why you would even bother to know this in the first place.

What's good?

Linux Programming By Example is clearly aimed at getting programmers up to speed on not only programming Linux systems, but also POSIX based systems. Wherever possible, the author makes a point of pointing out the POSIX way. This book could have been easily called POSIX Programming by Example. The author also makes no bones about implementation issues with Linux and the POSIX or System V way of implementation. The book clearly states where Linux falls short of the full POSIX standard, and where pitfalls with porting code from other systems may occur. It's a refreshing change from other beginner texts which assume the reader will discover these pitfalls on their own.

So what's in it for me?

If you're looking for a quick, effective way to get up to speed in Linux and UNIX programming without breaking the bank, Linux Programming by Example is the book to take you there. This book is designed for programmers who are familiar with programming on other systems but haven't dealt with Linux before.

You might have trouble locating this book, since QUE let it lapse for a while, but there should be another batch hitting stores soon. You won't be disappointed.

You can purchase Linux Programming By Example from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

22 of 155 comments (clear)

  1. WROX press books also very good on the subject by vasqzr · · Score: 4, Informative


    I've always liked the the red books.

    B&N

  2. I have this book and it has brought me great joy by PhysicsGenius · · Score: 4, Informative
    His examples are clear and useful and I look forward to the day when most Linux programmers will have been taught using this book. I wish there was a way to get current Linux programmers to read it, because his advice is very sound and would make for much higher quality software than you see in the Linux world today.

    The current Linux programming wisdom comes from Richard Stevens, a know-nothing hack who spends more time talking about the out-dated concept of filesystem permissions and socket programming than he spends on GUI design! I mean, for crying out loud, Dick, this is the Aughts! We "aught" to be optimizing for the user experience, not ivory tower "engineering principles"!

    Anyway, throw away your copy of Linux Kernel Internals because this book replaces it...and then some!

  3. Outdated? by ksplatter · · Score: 5, Informative

    This Book Was published in 1999.

    It might be a little outdated. This review seems to be a couple of years late

  4. I enjoyed... by cerebralsugar · · Score: 5, Informative

    Advanced Linux Programming, from CodeSourcery/New Riders. It wasn't a "beginning/intro" book but still very easy to read and quite informative. Lots of great code samples too. The finale of the book is actually coding a bare-bones http server.

    --
    Easy guys, I put my pants on one leg at a time. The difference is after I put on my pants I make gold records!
    1. Re:I enjoyed... by Anonymous Coward · · Score: 1, Informative
  5. Other good Linux programming books by TraderElron · · Score: 5, Informative

    I've used two Linux programming books, and would recommend both: 1. "Linux Application Development" by Johnson and Troan. A bit more advanced than "Linux Prog by Example," but I was able to use it effectively coming from NO linux/UNIX programming experience. 2. "Advanced Programming in the UNIX Environment" by Stevens. An excellent reference.

  6. Finally. by kpansky · · Score: 2, Informative

    Its nice to have an acceptable concise and accurate book that holds your hand through learning how to program in *nix. Programming is one clear advantage that *nix has over windows, especially since the tools are free and come installed by default.

    --

    --Kevin
  7. Re:Why another book? by dar · · Score: 2, Informative

    Because in programming as in many other things, you gnerally need more than one book.

    --
    My other Slashdot ID is much lower.
  8. Not Stocked by TheKubrix · · Score: 3, Informative

    The link to BN.com doesn't have the book in stock, get it at amazon.com instead, only $9

  9. 9/10 ? by Brandon+T. · · Score: 5, Informative

    I have this book, and I definetly would not give it a 9/10. The text is plagued with errors. Most of them are corrected easily enough, but it is still a hassle to type in some sample code and not even be able to compile it without debugging first. To make matters worse, the url in the book given to download the sample code (and the errata) doesn't work. Take a look at some of the amazon reviews to gauge popular opinion on the book. I picked up my copy on sale for $10 at frys, but I would wait for a second edition or look at another book if you're planning to pay full price.

  10. Make ? by tmark · · Score: 3, Informative

    I don't know about other readers, but when I hear that a book has a section on Makefiles, I really wonder whether it is specialized and focused on a specific programming area (as "Linux Porgramming" would suggest), assuming general programming knowledge, or whether it is a general programming book aimed at capitalizing on interest in the particular subject area. Sounds like it is the latter. Is the book more about "Linux programming", or more about "programming on machines that happen to be running Linux" ??

    Here's the acid test, does it contain a "Hello world" program or something similarly trivial ?

  11. this can also be had by da_Den_man · · Score: 3, Informative
    --
    You keep going until you die..."Me".
  12. Alternatively... by vbweenie · · Score: 5, Informative

    The Wrox P2P title Beginning Linux Programming, by Richard Stones and Neil Matthew, covers some similar ground: makefiles, shell scripts, some basic C, Perl and TCL (not really basic - they show you how to use these languages to do some typical linux-y things, rather than explain about structs and scalars), an introduction to GTK and a chapter at the end on writing device drivers. If you're an intermediate-level programmer unfamiliar with Linux as a programming environment, this book offers a good way in; recommended for VB weenies with a conscience.

    --
    Experience is a hard school, but fools will learn no other.
    1. Re:Alternatively... by JohnnyCannuk · · Score: 3, Informative

      As a non-VB weenie (;) -> Java and formerly C/C++ - I can't but agree with you. Stones and Matthews book is a reference when I need to bone up on things like multi-threading and signals under POSIX.

      A really great book.

      I wonder how their 2nd book Professional Linux Programming is? (Hint hint /. )

      --
      Never by hatred has hatred been appeased, only by kindness - the Buddha
  13. Re:Outdated?? by ninthwave · · Score: 3, Informative

    I bought the book in late 2000
    and the changes are small.
    The book deals very well with the state of linux programming. The basics of make gcc and the different programming tools available. The changes in the programs since then are easy to pick up. It is more about programming technique, how the tools are organised in Linux and how they generally work. gcc 3.2 hasn't taken light years away from gcc 2.95xxx and I have found references for those differences. This book is now one of my favorite quick references.

    This is a starting block and a quick reference for many types of programming but it is not the end all reference.

    --
    I was thinking of the immortal words of Socrates, who said: "I drank what?" - Chris Knight (Val Kilmer)- Real Genius
  14. amazon sold out, amazon uk has it by e1en0r · · Score: 3, Informative

    it looks like everyone is buying up all the copies. i'm sure amazon uk will be selling out soon too, but it cost me $13 including shipping to california.

    and as an added bonus you get to read everything with an english accent.

  15. My Impressions of this book by starX · · Score: 3, Informative

    Neither outstanding or terrible, it ranks as a decent, average book on programming on the linux system. Although I would recommend Beginning Linux Programming by Wrox over this one, based solely on the fact that it covers so much more material in roughly the same amount of detail. Still, Linux Programming By Example costs a little bit less (at least when I got it), and while the Wrox book covers more, LPbE does cover a few things that the Wroc book doesn't.

    On the whole I would say it really deserves a 6.5 or a 7. It's worth getting if you're looking to learn about programming on a POSIX system, but if you already have a book on the topic, you might want to save your money.

  16. Kernighan and Pike also good by pjc50 · · Score: 3, Informative

    I'd reccomend "The Unix Programming Environment". Despite being written in 1978, it's still an extremely good introductory text.

  17. Re:Makefiles.... by Zathrus · · Score: 3, Informative

    The problem is, even if your code is portable the compiler may not be. Or the linker. Not everyone is up to full ANSI compliance still.

    Ever worked on AIX using xlC? And libtool? They're totally different from the rest of the known universe and so even if your code will happily compile on Linux, Solaris, etc. then the makefiles have to be absurdly complex to handle AIX's weirdness.

    Of course, you may want to do dynamic linking since libtool and templates don't play well together. But, looky, xlC doesn't play well either so you have to have a separate .cpp that excercises all the templated functions you're going to use on a per-library basis. Don't need that for any other OS, but you damn well do for AIX.

    Automake and autoconf save us from most of the nightmare here. Oh, and we're also linking against Oracle and MQSeries. More fun.

    Yes, avoiding things like #!/bin/bash (or even ksh) is wise, but automake/conf have come into existence for a very good reason. Makefiles are godawful.

  18. Surprising to see a good QUE book by James+Youngman · · Score: 3, Informative

    I'm very surprised to see a good review of a QUE book. I find that the ones I've read - and that includes a QUE book of which I was one of several authors - are pretty dire.

    The problem with QUE books (and other Macmillan Computer Publishing imprints) is attention to detail. Their production processes tend to introduce errors (for example, by loading the text into Word and having it change all the backticks to apostrophes - that happened to me!). Also, they don't usually seem to do reprints correcting errors, they just seem either to produce a new edition ("Special Edition", whatever) with a "Featuring FooMatic 97!" badge on the cover.

    Another problem with QUE books is that they just tend to be written and published too fast - no time for doing a good job.

    I should emphasise that Macmillan Computer Publishing, who produce QUE books, are as far as I know completely unrelated to the British publisher, Macmillan.

    Disclaimer: You should know that I've had a bad experience as a contributing author of several MCP books, and have vowed not to have anything to do with them again. So as you can see I'm very biased against them. I have not read the "Linux Programming by Example" book and indeed haven't made any comments about this book in particular.

  19. Unix Systems Programming for SVR4 by Zurion · · Score: 4, Informative

    I have to write C/C++ code daily for Tru64 and Linux. Unix Systems Programming and Programming with POSIX Threads are two very good books. They aren't Linux-specific books, but I've used these books on a weekly (or daily) basis for a couple of years despite the USP book being written in '96.

  20. Re:Linux Lacks a Solid API by spitzak · · Score: 3, Informative
    You have no idea what you are talking about.

    There are problems and the problems are that some API's are not designed well. But this has nothing to do with "comprehensive API" or whatever you are blathering about. Rest assurred that Windows uses a different call for cut/paste than it does to read files, just like Linux.

    X is "integrated" in that it actually uses communication calls that exist in the system and are used by other parts of the system. This is why it works remotely. In this area Linux is vastly superior to Windows for "comprehensive API", in Windows there is NOTHING below the graphics interface that is reusable by anything other than graphics. The fact that X has a horrible interface is certainly true but irrelevant to "comprehensive".

    Also I don't think right-mouse pastes in ANY program. Middle mouse does, and it works in every X program I have ever seen. The inconsistencies are in what Ctrl+V does, not in what middle-mouse does. The fact that you did not know this indicates that you know little or nothing about Linux.