Linux Programming by Example
What's To Like There are many things to like about this book (over and above the fact that page 118 has my all-time favourite UserFriendly cartoon on it :-). Linux Programming by Example (LinuxPbE hereafter) takes a steady, incremental path through the concepts required to write software that can effectively interact with the Linux environment.
It is a truism many of us have proven multiple times in our lives that one of the finest learning tools available to programmers is to read and grok good, working code, written in the language that we are learning. LinuxPbE takes this philosophy and walks you through actual example code from various Unixes and Linux. The first part of the book, specifically chapters one through six, covers all of the aspects of Linux programming necessary to understand the Unix V7 ls program in its full glory in chapter seven. I feel that this approach works very well.
Part two dives into processes, walking us through creating them, managing them, communicating with them by using pipes and sending them signals. A few other general topics are included for completeness. Part three then covers the art and tools of debugging in fairly substantial detail.
All the code in the book is very well laid out, with line numbers provided to the left, and comments (in a small sans-serif font) on the right-hand side of the code. This is a very readable combination that is enhanced further by the fact that at each logical division, an explanation is given of the design and implementation used by that section.
I can't resist admiring the addition of the essay "Teach Yourself Programming in Ten Years" by Peter Norvig. This is a classic exploration of the effort needed to attain mastery of any skill, concluding that the minimum length of time required is ten years. The inclusion of this article, to me, speaks well of the author and his understanding of the learning process. One can only hope that those learning from this book will come to the same understanding and realise that the book is the start of their journey to mastering Linux programming.
What's To ConsiderNothing notable.
Summary If you want to learn how to do this stuff for real, then this book will get you started. As "Teach Yourself Programming in Ten Years" explains, no book is going to cause you to become an expert in 24 hours, 24 days or even, perhaps, 24 months. That said, this book will be useful for many of those ten years, so run or surf to your favourite bookstore and purchase it now.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.
Cutting and pasting makes things really easy.
Now all we need is a "Linux Documentation Writing by Example" Then we could tell people WTFM instead of RTFM. =)
Lagito ergo expectabo
no, it's like this:
#!/usr/bin/python
while DarlsWallet:
DarlsWallet -= 699
Lawyer += 699
raise SystemExit, "we're out of money!"
main(0)
Hi, I'm a VB programmer, and the problem I'd have with writing software for Linux is that there's no version of Microsoft Visual Studio for Linux.
If Linus Torvaldes had written Linux in VB I think that there would be more commercial applications for Linux today. We don't need more books on C/C++; we need more tools to get modern languages like VB to work on Linux.
I thought the appropriate google bomb was litigious bastards.
-no broken link
This is Darth McBide here - I don't often make it a habit of stopping by Slashdot and I have promised myself to take a shower wafter posting this message.
To the point, I would like to bring it to your attention that any "Linux Programming by Example" would unavoidably be a violation of our broad reaching IP. For reasons that are quite beyond anyone here we cannot tell you the exact contents of our IP so how the heck are you going to know when your examples are going to tread on our property? So please take my advice and refrain from publishing anything that could trigger another lawsuit...
Can we mod the original article as +1, Funny?
Notice however, that in the grand style of old: it even includes a mail reader.
lorem ipsum, dolor sit amet
I can see the following "problems" with some of them (if I am wrong, someone please correct me):
ch02-printenv.c:
Shouldn't there be a #include <unistd.h> after the #include <stdio.h>? The extern variable environ is available only if unistd.h has been included. While I am talking about this example, it could have used int main(void) instead of ...(int argc, char **argv) (like he does in ch03-getline.c).
ch03-getline.c:
size is declared size_t, so it should be printed with %z (C99 only, IIRC), or it sould be cast (unsigned long) size.
ch03-memaddr.c:
uses global variables, when simply adding two parameters to afunc will do the job. I know it's a trivial example, but global variables are bad in general, and certainly avoidable in this case.
casts the result of alloca when there is no need for it. In fact, the cast will remove the warning the compiler might give if someone forgot to #include <alloca.h>.
I haven't checked other examples.
The way people act on Slashdot, you'd think that they all think VB programmers are worthless pieces of junk.
DOS-heads gloating to each other in front of an Amiga calendar.
I find that so incredibly weird, my head might implode...
Someone set us up the bomb, so shine we are!