Advanced UNIX Programming: An Interview with Stephen Rago
Advanced Programming in the UNIX Environment (APUE) is highly regarded as a solid reference for programming in the UNIX-based environments. The book is designed to provide a comprehensive knowledge of programming in C for the UNIX environment. Topics covered include file I/O, processes, signals, threads, interprocess communication, and sockets among many others. For this edition of the book these concepts are discussed as they relate to FreeBSD 8, Linux 3.2.0, OS X 10.6.8, and Solaris 10.
The 3rd edition of APUE was recently published and InfoQ had the opportunity to speak with author Stephen Rago about his latest edition and UNIX development in general.
InfoQ: The first edition of this book came out in 1992, and was updated in 2005. What were your primary goals and motivations for this third edition?
Stephen Rago: I was always bothered that there wasn't enough time to update some of the platforms used in the second edition before it was published. In particular, I wanted to use Linux 2.6 instead of 2.4, because the pthreads support in 2.6 was better, and it behaved much closer to other systems. But at the time, 2.4 still had a large installed base of users, so I left it in. It takes me about two years to put out a new version. Because the platforms covered in the book are often updated several times during this period, I feel like I'm always playing catch-up.
InfoQ: What section was you did you find to be the most interesting to write?
Rago: That's like asking me which of my kids I like the best. Good parents are genetically unable to play favorites, if I do say so myself. Actually, working on APUE3e was a refreshing change from what I do at work. I'm a C programmer and an OS guy at heart, and the UNIX System surpasses any other operating system in terms of elegance, so I enjoyed working on all of the sections.
InfoQ: Has the audience for your book changed since that second edition? For example, do you see any shifts between professional and educational readers?
Rago: Originally APUE was published as part of the Addison-Wesley Professional Computing Series, so I assume its target market was professional programmers. Most of the email questions I get these days seem to come from academia (I try not to give direct answers to thinly-veiled requests for homework answers, though). I know the book is being used in several systems programming courses, but I guess as UNIX systems and their clones became commonplace in business, more professionals have mastered the material, so the market for the book has shifted somewhat towards academia. Perhaps as a reflection of this shift, I'm currently working on an instructor's manual to accompany APUE3e, which includes solutions to all of the exercises in the book, as well as new exercises not in the book.
Because APUE3e does a good job of describing practical programming issues and provides insights into the background of many of the UNIX System interfaces, I think it is capable of serving both markets well.
InfoQ: Have you found UNIX-based systems well-suited for academic study due to something inherent in its design or just because the source is easy to get to as compared to commercial based systems?
Rago: Both aspects make UNIX-based systems ideal for academic study. The design is succinct and clear and the source for various implementations is freely available, so you can see how an abstract concept maps to a real-life implementation. And you probably need to include UNIX Systems in the class "commercial grade systems," because many businesses run on UNIX systems.
InfoQ: Where do you feel your book is more popular environment-wise (UNIX/OS X/ etc)?
Rago: That's hard to say. Although I don't have a good way to measure environment popularity, most of the email I receive is from people running some version of Linux.
InfoQ: Given C’s historical relationship with UNIX, C is used for all of the examples. Do you see any viable challengers on the horizon to this language? Is C good enough or do you think a newer language could improve systems programming?
Rago: C has sufficed for 40 years. I've worked at places that have used C++ as a "better" C because of the stronger type-checking it does, but the C++ language is so large and complex that using it is really a chore. I can write C programs without needing to constantly check some reference book to see how such-and-such a feature should be used; not so with C++. I prefer C because you can do both high-level and low-level things with one language, and the language specification is simple enough to keep in your head. Operating systems need to interact with hardware and provide features based on higher-level constructs, so C fits the bill nicely. And using the same language for systems programming that is used by the underling operating system makes life easier. I haven't had a chance to look at Go yet, but it's on my list of things to do, because it tries to address some of the software engineering problems with building large software projects in languages like C and C++.
InfoQ: As you spent your time writing this book, was there something you find lacking or under-served in UNIX?
Rago: Probably some simple features to support more secure execution. For example, it's difficult to find the identity of a process at the other end of an IPC channel, such as a named pipe or socket. But the UNIX System originated in a collaborative environment, so it's easy to understand why it doesn't have more infrastructure for authentication built into it. But this is a minor quibble compared to all of the things you *can* do with the system.
About the Book Authors
Stephen A. Rago is the author of UNIX® System V Network Programming (Addison-Wesley, 1993). Rago was one of the Bell Laboratories developers who built UNIX System V Release 4. He served as a technical reviewer for the first edition of Advanced Programming in the UNIX® Environment. Rago currently works as a research staff member in the Storage Systems Group at NEC Laboratories America.
W. Richard Stevens was an acknowledged UNIX and networking expert and the highly-respected author of several books. He was also a sought-after instructor and consultant. He is best known for his "UNIX Network Programming" series (1990, 1998, 1999), "Advanced Programming in the UNIX Environment" (1992), and "TCP/IP Illustrated" series (1994, 1995, 1996).
From Where Exactly to Start System Programming
Mohammad Nawazish Khan
For where exactly a person should start learning about System Programming especially in today's situation where Software Engineer has spread so wide and far! What are the pre-requisites to go with it? As Sir. Rago talked about C providing facility to write for both high and low level codes, although I can write some high level codes, but I would still like to learn the low level coding in C; currently it is just esoteric to me!
I would be obliged to hear any input on the query.
Mike Amundsen May 29, 2015
Ben Linders May 28, 2015