Programming book recommendations. - Programming On Unix

Users browsing this thread: 2 Guest(s)
phillbush
Long time nixers
  • What books or web resources do you recommend for programming in general?
  • What books or web resources do you recommend for programming in Unix?

If you have some recommendation, please post a short personal review of the book.
ckester
Members
For programming in Unix, Eric Raymond's _The Art of Unix Programming_ is essential. While it has its flaws, this book does a good job describing the philosophy and typical architectures of Unix programs. I particularly liked his discussion of various data file formats.

If you're on Linux, another essential book is Kerrisk's _The Linux Programming Interface_. In-depth explanation of the APIs and examples of how to use them.

A quirky but personal favorite on programming in general is P.J. Plauger's _Programming On Purpose_. It's an OLD book from the days of structured programming and is focused mainly on data transforms a la data flow diagrams (DFD's). I've found it to be a useful way to think about shell pipelines, but also how to structure a traditional program consisting of a main module and subroutines. His bit about lifting up one of the bubbles from the DFD and letting the other bubbles fall below it as its subroutines has always stuck with me -- along with his analysis of how which bubble you choose affects program structure.

(By the way, I highly recommend learning something about those old structured design techniques and DFD's in particular. It will shed a lot of light on Unix's pipes-and-filters model -- and also, oddly enough, prepare you for the more esoteric world of functional programming.)

Ousterhout's new book _A Philosophy of Software Design_ is also good, although I didn't find every chapter as useful as others. A little too object-oriented for my taste. But excellent advice on modular design.
ckester
Members
D'oh! How could I list Kerrisk and not Stevens and Rago's _Advanced Programming in the UNIX Environment_?!? Similar content as Kerrisk but not Linux-centric.
venam
Administrators
Regarding online web links there would be way too many.

While not all are books per say, my all time favorites, that I can remember, are:
Other than that I got the following computer-related physical books:
  • Clean Architecture - Robert Martin
  • The clean coder: A code of conduct for professional programmers - Robert Martin
  • Software Architecture in Practice 3rd edition
  • Building evolutionary architectures - Neal Ford
  • Domain-Driven Design - Eric Evans - Currently reading, almost done
  • Beyond software architecture: Hohmann
  • Computer Architecture: A Quantitative approach - Hennesy Patterson
  • Compilers - Aho Lam Seth Ullman
  • Operating system concepts - Silberschatz
  • Algorithms: Sedgewick
ckester
Members
But Ulrich Drepper is wrong about static vs. dynamic linking.
I side with the suckless.org folks on that issue.
:)
bouncepaw
Members
The Art of Unix Programming is, undoubtedly, required. It tells a lot about the Unix way and is still relevant today. Actually, one day I wrote a composition in English about this book at school (which is Russian) and got a really good mark for it haha.

Elegant Objects by Yegor Bugaenko is an eye-opening book about OOP. It's quite fun.

The best learning resource is, of course, documentation. Whenever I'm learning something new, I jump to documentation as soon as I'm done with those tutorial articles.
phillbush
Long time nixers
Do you guys know good books for programming in Xlib?
ckester
Members
There don't seem to be many books on Xlib. The only one I have myself is Adrian Nye's 1994 "Xlib Programming Manual" for X11R5. As far as I know that book was never updated for X11R6.

If you want to program at that low level your best bet might be the online documentation at https://xorg.freedesktop.org/wiki/Progra...mentation/
z3bra
Grey Hair Nixers
I used Chris Tronche documentation a lot while learning XCB (and still do). It helped me with all my XCB projects as well (https://git.z3bra.org/glazier, https://git.z3bra.org/xmenu, https://git.z3bra.org/libwm).
twee
Members
I like a few of the Lisp books, which aren't very Unixy but are interesting and enjoyable: Touretzky's Gentle Introduction to Symbolic Computation and SICP, and of course the Little Schemer is a lot of fun. It's quite old but the Unix Programming Environment was one I found fascinating, and it got me into Roff which I'm thankful for. All the papers on the cat-v website are good too (I like the face server one)

I'd be interested to be read more about compilers. What are your recommended introductory texts, or is the dragon book the way to go?
phillbush
Long time nixers
(07-05-2020, 10:42 PM)phillbush Wrote: Do you guys know good books for programming in Xlib?

I have just found the book Low Level X Window Programming: An Introduction by Examples, by Ross J. Maloney.
Different of the other books on Xlib that throw the routines expecting the reader to put them together and understand how them connect to each other (an approach not that different from learning just by reading man pages), this book explains the routines as it provides examples, in the same style of K&R's The C Programming Language (but less elegantly).
I am reading it RN.

(08-05-2020, 07:34 PM)twee Wrote: It's quite old but the Unix Programming Environment was one I found fascinating, and it got me into Roff which I'm thankful for.

I've read it last month, and I created a thread here about the author's comments on echo(1).
It is indeed an excellent book, although not that recent.
It says stuff that does not work anymore (like open(2)ing directories) and some command line utilities that doesn't exist anymore, like teach(1), learn(1) and news(1).
The trickiest part of reading it is converting the old K&R C into modern C.

This book also got me into troff, and also into yacc(1) and lex(1).

(08-05-2020, 07:34 PM)twee Wrote: I'd be interested to be read more about compilers. What are your recommended introductory texts, or is the dragon book the way to go?

The books by Aho, basically, which includes the Dragon book.
Also, check the bibliography on the back of the Chapter 8 of The UNIX Programming Environment (the chapter on yacc).
sth
Long time nixers
i've been working my way through Practical Common Lisp over the last week or so. slow going but i'm not much of a 'programmer' so i'm trying to take my time with it.
ckester
Members
(08-05-2020, 03:25 AM)z3bra Wrote: I used Chris Tronche documentation a lot while learning XCB (and still do). It helped me with all my XCB projects as well (https://git.z3bra.org/glazier, https://git.z3bra.org/xmenu, https://git.z3bra.org/libwm).

I'm not familiar with Chris Tronche's work. Can you provide a link?
ckester
Members
(08-05-2020, 08:46 PM)phillbush Wrote: I have just found the book Low Level X Window Programming: An Introduction by Examples, by Ross J. Maloney.
Different of the other books on Xlib that throw the routines expecting the reader to put them together and understand how them connect to each other (an approach not that different from learning just by reading man pages), this book explains the routines as it provides examples, in the same style of K&R's The C Programming Language (but less elegantly).
I am reading it RN.

I saw that one when I looked on Amazon in response to your query, but couldn't vouch for it myself. Let us know what you think after you've read it!
z3bra
Grey Hair Nixers
Sorry I wanted to make it a link, but forgot to xdo so: https://tronche.com/gui/x/xlib/
wolf
Members
I really liked the "21st Century C". Ben Klemens really has a comic style when writing, without lose the technical aspects of the book purpose.
ckester
Members
+1 for 21st Century C.
phillbush
Long time nixers
(08-05-2020, 09:50 PM)sth Wrote: i've been working my way through Practical Common Lisp over the last week or so. slow going but i'm not much of a 'programmer' so i'm trying to take my time with it.

If you know C and want to learn Lisp, you may be interested in Build Your Own Lisp, where you create a lisp dialect in C.
ckester
Members
I recently ordered this one and am looking forward to reading it:

Cristina Videira Lopes, Exercises in Programming Style 2nd Edition

Quoting from the book description on Amazon:
Quote:Using a simple computational task (term frequency) to illustrate different programming styles, Exercises in Programming Style helps readers understand the various ways of writing programs and designing systems. It is designed to be used in conjunction with code provided on an online repository. The book complements and explains the raw code in a way that is accessible to anyone who regularly practices the art of programming. The book can also be used in advanced programming courses in computer science and software engineering programs.

The book contains 40 different styles for writing the term frequency task. The styles are grouped into ten categories: historical, basic, function composition, objects and object interactions, reflection and metaprogramming, adversity, data-centric, concurrency, interactivity, and neural networks. The author states the constraints in each style and explains the example programs. Each chapter first presents the constraints of the style, next shows an example program, and then gives a detailed explanation of the code. Most chapters also have sections focusing on the use of the style in systems design as well as sections describing the historical context in which the programming style emerged.

I love reading and thinking about different approaches to software architecture, which I think is a better term for the subject of this book than programming style -- which I tend to associate with things like naming variables, indentation, placement of brackets, etc.

On the subject of coding style, I'm an old-fashioned devotee of the original K&R book introducing "C" and of Henry Spencer's more explicit Recommended C Style and Coding Standards.

I don't know if Spencer's work is still in print; my copy is a pamphlet issued in 1990 by SSC here in Seattle. (Those were the days!) Online copies are probably available somewhere on the web.
venam
Administrators
(08-09-2020, 07:59 PM)ckester Wrote: I love reading and thinking about different approaches to software architecture, which I think is a better term for the subject of this book than programming style -- which I tend to associate with things like naming variables, indentation, placement of brackets, etc.
I definitely agree on that.
In the list of books I posted previously you should definitely check Beyond Software Architecture — Creating and sustaining winning solutions by Luke Hohmann. It touches things most programmers don't even think about when creating softwares.
ckester
Members
Thanks for the recommendation!

After a quick look at the table of contents, I think the title of that book is well-chosen. It does indeed appear to go beyond what I think of as software architecture, namely the arrangement of a program's parts (e.g. its modules and functions, and who calls or provides what to whom), analogous to the layout of the rooms and other elements of a building and how one moves through it. By architecture I mean the meta-layer above the implementation of an algorithm, so that it includes the design of all the things that have to be done to fetch and prepare the data to be processed by the algorithm and then present the results to the user. It's the layer where the Gang of Four's software patterns are found, for example, although even they don't provide the whole blueprint for a design at this level.

(That old book by Plauger I mentioned above is discussing this level when he talks about picking up one of the bubbles of a DFD and giving the whole thing a shake: it's about deciding which of those bubbles will be your program's main(), so that the DFD becomes like a calltree. You can choose any of the bubbles in the diagram and make it work, but which one you choose has profound effects on the resulting architecture.)

Hohmann's book, on the other hand, seems to be about yet another meta-level above that. It discusses project management, marketing, business goals, licensing, and many other things not found in the program code. Those are all important things of course, especially if you're creating enterprise software where the success of your business is at stake. But they're not really what I'm concerned with as a programmer working alone on what are essentially hobby projects for my own use.

l will, however, take a closer look at the preview of it on Amazon in case I've got the wrong first impression of the book.
venam
Administrators
(09-09-2020, 04:01 AM)ckester Wrote: It's the layer where the Gang of Four's software patterns are found, for example, although even they don't provide the whole blueprint for a design at this level.
I've been focusing on software architecture for the past year. I really like it. I wrote a small article about evolutionary software arch.
I've been following Software Architecture Mondays, it's a good channel if you're into these types of things.

(09-09-2020, 04:01 AM)ckester Wrote: Those are all important things of course, especially if you're creating enterprise software where the success of your business is at stake. But they're not really what I'm concerned with as a programmer working alone on what are essentially hobby projects for my own use.
I initially thought the same thing, but then I realized that nothing I do, even in small projects, or even articles or content, makes sense if these criteria are not taken into consideration. As much as we want to get bogged down on technical and intricate details, in the end we shouldn't forget what it's part of; We are building something for someone, there's a user, be it a knowledgeable user or a less-knowledgeable user. All in all, maybe you could just give it a look, it especially resonates when you've done projects for companies but it's not limited to this.