The Linux Programming Interface as a university course text

7 days ago (man7.org)

So much of practical CS is abiding by standards created by solo programmers in the past.

My university frowned on any industry-related classes (i.e. teaching software engineering tools vs. theoretical CS), but I was fortunate enough to know a passionate grad student who created a 1-credit seminar course on this exact topic.

This course covered CLIs/git/Unix/shell/IDEs/vim/emacs/regex/etc. and, although I had experience with Linux/git already, was invaluable to my early education (and adoption of Vim!).

It makes sense that this isn't a core topic, as a CS education should be as pure as possible, but when you're learning/building, you're forced to live within an operating system and architecture that are built on decades of trade-offs and technical debt.

  • If you've made it that far in life without learning how to use a screwdriver, engineering would be a bad choice of major. And paying insane amounts of money for someone to explain how to use one would be an even poorer choice.

    • It was amazing to me how many people I met in college that pursued majors they didn't even like. It was even more sad when it was clear they or their parents had fallen in love with the idea of a career path and not the realities of it.

      Lots of my engineering cohort landed in sales because they didn't like building or fixing things. I guess that's a win for them, but I always felt nauseated that practical kids might be cut from the program instead of the book-smart but uninterested ones.

      2 replies →

    • Same reason I always wonder whether I should go for an electrician/mechanic/avion mechanic education if I'm laid off (and cannot find a job).

      I'm really not a handyman -- quite the opposite -- it took me and my father 30 minutes to change the car battery last time -- and most of the time was spent on pushing a component dropped to the bottom out of the car. I used to think that more practices bring some sort of linear growth of the skill in the beginning, but now I tend to believe that for certain people (who are not suitable for the trade), the beginning is totally random -- I could practice 100 times and fail 100 tiles randomly, without really learning anything -- because there are an unlimited number of ways to do one thing, theoretically.

      Software suits me way more. Soldering is also OK albeit more confusing. Unfortunately there is no trade that primarily deals with microcontrollers, except in military/defense.

  • Universities consider themselves pure and isolated from lowly industry.

    Industry demands specifically university degrees to gatekeep positions.

    And then we leave teenagers to figure out the puzzle by themselves. I think it's a disservice to the youth.

    • Universities produce research, and students; Students produce industry, and the body politic; Industry and polity produce university funding.

      A cycle I like to call, the "ring-bugger."

      I'm not saying it's right, or acceptable, or particularly moral… But I agree that by obscuring the facts, we only serve to confound the decent and good-willed of our students.

      Edit: derp.

    • In Portugal it depends on which university degree you go to, there are for all levels.

      If you want a higher education degree focus on what the industry is using today, you go to a politécnico, or técnico superior school.

      If you want more focus to learning to learn, with more broader horizons, then you go into plain old university.

      If you want to broaden the horizons, but still have some contact with what is industry is using today, you go into an applied engineering degree.

      Additionally, similar to Germany with their Azubis program, you can just go to a technical school, with focus on being industry prepared, learning on the job during summer internships, and still leave the door open for going into the university later on, e.g. técnico professional.

      The problem are the places that only have one way to approach higher education.

    • While I have my issues with the system, many Soviet-controlled countries implemented a two-tier higher education system that solved this by having one tier be focused on practical subjects and the other on theoretical ones.

      3 replies →

    • Yeah, I got duped by this. Did a CS degree because that's what you're "supposed" to do to get a programming job, and it was almost all theoretical junk I had no interest in. I hated it. I think I learned useful things in like, two of my classes. I knew more about programming than all but one of my instructors. It was awful and going through that degree program is one of the biggest regrets in my life. But hey, I get to stick "CS Degree from University" as the very last line on my resumes, I guess. Woo.

      7 replies →

  • > So much of practical CS is abiding by standards created by solo programmers in the past.

    I wonder if this shows up in other disciplines? Do surgeons do this? I'm thinking in particular of the bit in Richard Heller's book M * A * S * H (you're probably more familiar with the TV series) where one of the old hands is reviewing the Young And Enthusiastic Newbie's work, and says something like "Your work is absolutely perfect and it's the neatest job I've ever seen, but you're going to kill a patient doing that because it took you two hours and some of these kids don't have two hours".

  •   > This course covered CLIs/git/Unix/shell/IDEs/vim/emacs/regex/etc.
    

    Fwiw I just graduated grad school and our lower division courses taught most of this stuff, though not as the main subject. Most upper division classes required you to submit your git repo. Most of this was fairly rudimentary but it existed. Though we didn't cover vim/emacs and I'd argue shell and bash were very lacking.

    That said, several of us grad students and a few professors lived in the terminal. The students that wanted to learn this stuff frequented our offices, even outside office hours. I can certainly say every single one of those students was consistently at the top of the class (but not the only ones). The students who lived in the terminal but didn't frequent office hours tended to do well in class but honestly I think several were bored do didn't get straight A's but I could generally tell they knew more than most. Though I'm biased. I think more people should live in the shell

  • > It makes sense that this isn't a core topic, as a CS education should be as pure as possible, [...]

    I don't think that's a good goal. Otherwise, why let you near a computer at all, and not restrict you to chalk and blackboards?

    • Pure CS is not necessarily equivalent to pure maths. For the “science” bit of CS, you do need to do the equivalent of experiments (for more applied topics).

      For example, a physics degree is expected to have experiments. You are not required, expected (and possibly do not want) to know the tools required to professionally build a bridge because you did courses on mechanics. But you might do an experiment on the structural integrity and properties of small structures.

      Whether this is a good split is an entirely different question.

I use TLPI as an optional text for my CS Operating Systems course! It's honestly the best resource for a comprehensive look at the innards of Linux. I actually even snip select pages for lectures.

This is one of the books I recommend to my coworkers who are interested in operating systems - it teaches a surprising amount of things by telling you what an OS will do for you and therefore why you need it, instead of telling you how it works inside.

It also remains being very pleasant to read in spite of its very large size( I read the whole book cover to cover ). Obviously you can also read the classics ( minix book, tanenbaum, Bach , and probably modern references ) but this one somehow gives the operating system a purpose which I find absent in the others I’ve read .

catfood's point about a 2nd edition is worth unpacking:

The syscall ABI itself is remarkably stable, backward compact is practically Linux's religion, but the conceptual model has shifted substantially.

Namespaces and cgroups went from obscure subsystems to the foundational abstraction containers run on.

io_uring rewrote the async I/O model.

eBPF changed how you think about observability and policy enforcement.

One of the greatest texts ever written. Ok maybe just one of my favorites. I wouldn't mind a 2nd edition though... surely the system call interface has changed a bit since 2010.

One of the best books I've read. It helped me lead meetings and solve complex problems where other engineers struggled.

  • Thanks for sharing. What kind of problems do you solve in daily work? Sounds like an interesting career path.

My favorite book about systems programming on UNIX systems is the book by the late Stevens, but this book more detailed, Linux-specific and if updated (after 16 years, in which Linux did not stand still), could steal the crown from Stevens.

I guess it is more appealing to current university students, than reading about UNIX Lion's commentary, Minix, BSD design, and other academix books with UNIX like implementations.

We did not get as recommend or required reading in a course. But the professor did recommend it to me outside of class.

What a horrible selection for a university textbook! It doesn't get trivially updated every year to prevent reuse and reselling, so how is this supposed to generate more profit for the booksellers? /s

Seriously though, this book is fantastic, and far better than typical course textbooks. I'm honestly a little surprised that universities would select it.