Beginning Linux Programming, 2nd Edition
What I'm reviewing here is actually a pre-press draft of the second edition of "Beginning Linux Programming", the first edition of which I reviewed here on Slashdot back in August. Unfortunately this review is two months late; enclosed in the cover jacket I found scrawled message from the publisher addressed to Hemos: "Here's the review copy ... Sept 23 is publication date so a review on Slashdot for then would be great!" ... DOH! Sorry Rob M.
So let's review what I griped about in my previous review of the first edition of this book:
- Content was not Linux specific
- Little mention of perl
- Content was dated to around 1996/97
- No mention of newer API's like GTK+
diff first_edition second_edition: Most of the book is the same content as the first edition (with newer illustrations and some areas elaborated in more detail), which again see my previous review for more details on that, with these new sections have been added:
Foreward by Alan Cox: Yes, the king of all patch writers himself lends 5 paragraphs to kick off this new edition summing up by pointing out we now have a new final chapter (Device Drivers) that "is your chance to join the world of kernel hackers" ...so... "put on your pointy hat, grow a beard, drink Jolt Cola, and come join in the fun."
POSIX Threads: Now for Chapter 11 we have 25 pages on POSIX Threads with gotchas specific to Linux. Thread scheduling, semaphores, and mutexes are demonstrated in code.
GNOME and GIMP Toolkit: Chapter 17 is 30 pages devoted to GNOME and the GIMP Toolkit (GTK+) The code examples walk you thourgh creating a simple window, adding widgets to the window, dialogs, button bars, canvases, slider bars, then the CD includes source the ubiquitous Audio CD catalog application written in GNOME. (The authors score bonus points with me by showing a screen shot of the CD column with Nirvana's "In Utero" prominently selected in a multi-column listbox.)
Perl: Chapter 18 is a 30 page introduction to perl covering hashes, special variables, regular expressions, file I/O, etc. Bonus points to the author for explaining how to use CPAN to install modules and the perldoc command.
Device Drivers: Chapter 21 is 75 very useful pages that dig into kernel hacking. By the fourth page in this chapter we have a simple "Hello World" code snippet written as a kernel module, then simple instructions on how to compile your kernel module, load your kernel module (insmod), view messages from your module (dmesg), list loaded modules (lsmod), then unload the module (rmmod). The rest of the chapter discusses kernel API specifics such as timers, task queues, the /proc file system, interupt handling, and memory management. The chapter then discusses the simple RAM Disk Module example included on the CD, and debugging your kernel modules.
What's Good Not only does all the material from the previous edition included in this printing, but more meat, diagrams and screenshots have been added to each existing chapter. Again, I also like the style of presenting code examples right up front in each chapter rather than making the reader wade through endless pages of droning before seeing concrete examples. What's Bad I'm hard pressed to find anything outright bad about this book. I suppose I could make catty remarks about the ties the author are wearing in the cover photo, but I don't wear ties so what the hell do I know?Purchase this book at fatbrain.
Table of Contents- Chapter 1: Getting Started
- Chapter 2: Shell Programming
- Chapter 3: Working with Files
- Chapter 4: The UNIX Environment
- Chapter 5: Terminals
- Chapter 6: Curses
- Chapter 7: Data Management
- Chapter 8: Development Tools
- Chapter 9: Debugging
- Chapter 10: Processes and Signals
- Chapter 11: POSIX Threads
- Chapter 12: Inter-process Communication: Pipes
- Chapter 13: Semaphores, Message Queues and Shared Memory
- Chapter 14: Sockets
- Chapter 15: Tcl: Tool Command Language
- Chapter 16: Programming in X
- Chapter 17: Programming GNOME using GTK+
- Chapter 18: The Perl Programming Language
- Chapter 19: Programming for the Internet: HTML
- Chapter 20: Internet Programming 2: CGI
- Chapter 21: Device Drivers
- Appendix A: Portability
- Appendix B: FSF and the GNU Project
- Appendix C: Internet Resources
- Appendix D: Bibliography
Well, if you ARE looking for them, you might find
that not covering Qt/KDE might be worth
criticizing as much as not covering GTK+/GNOME
(in the last edition) - GNOME might be YOUR
preference, but as an editor you should IMHO
try to be impartial.
Then again, I don't want to advocate "political
correctness", so just bang on!
"We won't use guns, we won't use bombs, we'll use the one thing we've got more of and that's our minds" - Pulp
This is a great book!! I bought it a few weeks back and I have read about 3/4 of it already. The examples are good and it doesnt take an experienced C programmer to understand what is going on. Plus it just flat out covers alot of ground. My only gripe was that it did not spend alot of time on Sockets and the terminal programming. Otherwise it touches Perl, Tcl, Gnome, C, Shell programming, Html, CGI, blah, blah, blah... Being a Java/VB programmer (and a newbie to the C lang) I have learned quite a bit from this book so far. zI
F atbrain.com has it for $31.95 in stock.
Bookpool. com has it for $24.50, on backorder. It cost me $9 for 2 day fedex and got it the next day for the first edition.
I haven't heard about the Stevens book yet, but I just found it on Amazon. I agree that this is a terrific book. Between "Beginning Linux Programming" and "Linux Application Development" by Johnson and Troan, I've been able to get in touch with my inner-geek. Seriously though, it's made it possible for me to write some great utilities. For those of us who are out of college and don't have any collegues at work able to write anything but VB (yack!) book like this make it possible to get our foot in the door.
I'm glad to see the GTK+ info included. For anyone who wants to do GUI programming, another fantastic book for getting started is "GTK+/Gnome Application Development" by Havoc Pennington.
Murray Todd Williams
Shall I paraphrase the review . . .
Damn good book. 'nuff said!
Qt was probably not covered for two reasons:
1) The authors a big fans of GPL software.
2) The book focuses on C not C++.
As the book is geared towards those transitioning from Windows, it may be an oversight to not include any C++ stuff. However, for those just starting out on Linux, GTK+ is a far simpler introduction to X programming than Qt.
And before someone flames me, let me add that my own personal preference is GTK+, but Qt is also a damn file GUI toolit - especially for cross platform (Win32 and Unix) apps.
Chris Wareham
I bought it a few weeks ago and although I have not really gotten into the nitty gritty of doing anything with it yet, I think it is probably one of the best books I own.
One thing I was really surprised with was that the authors did not waste the reader's time with explaining every stinking line of code. They show you the example and then let you go do it. I like that.
I think they treat the whole thing like "Okay, so you want to program in PERL? Here we go then!" and off ya run. I can't think of any other books that treat programming this way.
I like that.
Having programmed with Qt and GTK+ (along with Motif, XView and the Athena widgets), I can confidently say that while GTK+ looks ugly to the uninitiated, it is far easier to use than Qt.
The casts that most people complain about in GTK+ are actually an elegant solution to the problem of an Object Oriented toolkit in a essentially non-OOP language. This allows some very clever error handling. The odd thing is that every criticism of GTK+ I have seen is of the "the code looks ugly" variety. These people should try actually *coding* in it sometime.
As for Qt, I will reiterate my point that it is a fine toolkit. I feel that ultimately a novice will have more grasp of C than C++ and will therefore prefer GTK+ for dabbling in X programming.
As I suggested in my first post, many Windows programmers are transitioning to Linux, so C++ may not be an obstacle to using Qt. In that case both toolkits make excellent options for X applications.
As for Qt coverage in the Beginning Linux Programming book, I assume the authors fondness for the GNU license is the main reason for Qt's ommision.
Chris Wareham
I was writing my own Qt widgets and apps within a few hours (a lazy afternoon at work) of downloading it. It really is incredibly clean and simple (assuming you're comfortable with C++). To create a new widget, just inherit the base class and override a few methods! The signal/slot mechanism for associating actions with events is brilliant. The online documentation for Qt is superb!
:-(
While I have not actually programmed with GTK+, it does appear to be a lot more verbose than Qt, and somewhat reminiscent of Motif/Xt programming...
I use it as a reference when I don't remember the details, say something I seldom use, and a man page is a little too bare bones.
I used to use it as a quick tutorial for things I had never done. The examples start out as simple as possible and expand through the chapter. It would be great for learning socket programming, for example, but once you've mastered it, better get Stevens and keep on learning -- it definitely won't cover the real nitty gritty.
I really appreciate that even tho the examples are dead simple, the authors don't talk down to you as those 24 hour books do.
I am going to buy two copies of this 2nd edition; one for me, and one for a friend's 16 year old who is learning C and Perl on Linux.
--
Infuriate left and right
I think that this is a good book to introduce folks to a variety of the ways of doing things under Linux. But don't kid yourself - it is only scratching the surface of the various topics it covers.
Based on this book you are not likely to be able to program much beyond a few simple utilities that make use of the most basic features of a given programming environment.
The good news is that if you really are unfamiliar with the topics it covers, this book lays out the sign posts needed for you to get started in learning the topics it covers. I bought it for that purpose, and I am pretty happy with it.