from Hacker News

Ask HN: What is the best programming book you've read?

by cylde_frog on 9/26/21, 10:00 AM with 54 comments

Whole language is an approach to, or attitude toward learning that sees language as a whole entity, and writing, speaking, reading, and listening should be integrated when learned.
  • by crossroadsguy on 9/26/21, 3:26 PM

    K&R. It was the best programming book I read. I have not read many other programming books to be honest. I couldn't finish most rather.

    It's been years since I even touched C and at this point I am not going back, I know; but as an Android dev I wish I could find a non-lengthy book like K&R that would expose me to Kotlin like I was exposed to C, while helping unlearn a lot of Java.

  • by furstenheim on 9/26/21, 2:46 PM

    Effective Java by Joshua Bloch is really good. Some of the learnings only apply to Java, but most apply to any language.

    All the tips are very focused on how the code, APIs and even the languages evolve, trying to understand how your changes could confuse other developers. Compared to clean code, it's clear that it's written by someone who has done a lot of coding and seen the evolution, with a very pragmatic approach. Not just theoretical like Clean Code

  • by khaledh on 9/26/21, 3:06 PM

    There's no single book that I would recommend. What worked for me is to read the history of programming languages (and operating systems, to better understand the relationship between them).

    My recommendation is to read the original papers/manuals (bitsavers and ACM/Sci-Hub are my main resources). Starting with how computers were programmed befor high level languages were developed (i.e. machine code and assembly), then going through the early languages: Fortran, Lisp, COBOL, Algol; and understand why they were developed and the main ideas in those languages. Lisp had a huge influence on later generations of functional programming languages; Algol (first developed in 1958) is the granddaddy of all what we call today C-like languages, including CPL, BCPL, B, C, Pascal, C++, Java, C#, etc. Simula (developed in the early 60s) is the granddaddy of most object-oriented languages, including Smalltalk, C++ and their descendants.

    Many ideas that are core to modern programming languages were developed in those early formative years (late 50s, 60s, and 70s); e.g. lexical scoping, dynamic dispatch, coroutines, garbage collection, encapsulation, virtual machine bytecode, metaprogramming, and many others.

    I find it fascinating to read this early literature and understand why and how those ideas (that still live to this day) were formed.

  • by allenleein on 9/26/21, 12:40 PM

    1. SICP

    2. How to Design Programs

    3. Software Design for Flexibility: How to Avoid Programming Yourself Into a Corner

  • by qorrect on 9/26/21, 7:26 PM

    Not sure this one counts but it's one of the best books ever:

    Code by Charles Petzold - https://www.goodreads.com/en/book/show/44882.Code .

    Others would be:

    Neural Smithing ( its now obsolete but was great at the time ) https://www.goodreads.com/book/show/1153223.Neural_Smithing

    The Pragmatic Programmer https://www.goodreads.com/en/book/show/4099.The_Pragmatic_Pr...

    The Effective series by Scott Myers https://www.goodreads.com/series/160060-effective-c

  • by peakaboo on 9/26/21, 2:10 PM

    If anyone has a good book about writing as simple programs as possible instead of as flexible as possible, I would appriciate it.

    Because the problem today is complexity and abstractions. It prevents us from changing code easily, deleting code easily, and understanding the full program flow easily.

  • by cratermoon on 9/26/21, 5:27 PM

    Refactoring: Improving the Design of Existing Code

    For helping realize that in all the books telling me how to write good code, explaining language constructs, and working as a software developer, none of them ever made it clear to me that programmers spend less than half their time writing new code from scratch. For showing me that programming involves revising and improving far more than opening up an editor to a new file in an empty repo.

  • by twodayrice on 9/26/21, 4:23 PM

    Unix network programming. Stevens brought sockets to the masses and helped launch the internet as we know it.
  • by xupybd on 9/26/21, 6:34 PM

    Domain driven design made functional. It takes the weird world of functional programming and shows how it can be applied to building run of the mill business apps. Instead of being an app that only functional programmers can understand these apps, at least some of the domain modeling can be understood by stakeholders.
  • by rajandatta on 9/26/21, 2:39 PM

    'Object Oriented Software Construction' - Bertrand Meyer.

    Did not agree with everything but it was excellent.

  • by dunefox on 9/26/21, 6:38 PM

    For me it's boring old SICP. It's just that good.
  • by chris_j on 9/26/21, 7:25 PM

    Growing Object Oriented Software, Guided by Tests by Steve Freeman and Natt Pryce. It taught me an awful lot of lessons about object oriented design and London-school TDD. It was published back in 2009 and things have moved on a bit since then but it's still worth reading if you want to understand that style of development. Reading this book changed the way that I write software, very much for the better.
  • by mkchoi212 on 9/26/21, 5:12 PM

    The Little Schemer is my favorite by far! So easy to understand and follow. Definitely a must read if you want to get into functional programming
  • by adrianvincent on 9/26/21, 5:00 PM

    'You Don't Know JS' by Kyle Simpson. A series of books that are a must read for any JavaScript developer. They are available for free on GitHub or you can purchase a retail version. He's working on a second edition right now.

    https://github.com/getify/You-Dont-Know-JS

  • by yesenadam on 9/27/21, 4:36 AM

    The AWK Programming Language (1988)

    https://archive.org/details/pdfy-MgN0H1joIoDVoIC7

    Best as in best written, along with K&R—Brian Kernighan co-authoring both can't be an accident!—it's just a pleasure to read. I use it as a model when writing documentation myself. They get you started using AWK literally on page 1. Later they get into the details of particular use cases—profiling, making DSL interpreters/compilers, random text generation, making indexes, a graph-drawing language, databases, data validation etc etc. All in under 200 pages!

    And best as in most useful—I use AWK every day for all kinds of things–web scraping, rearranging and creating data for programs, meta-programming etc. So easy to make whatever tool's needed for a job.

  • by dilippkumar on 9/26/21, 4:32 PM

    I’m currently enjoying “From Mathematics to Generic Programming” by Alexander Stepanov and Daniel E. Rose.

    One thing about the book is that it’s a lot more interesting than what a cursory scan of the table of contents would suggest. An O(log n) algorithm for multiplication doesn’t seem interesting at first. But the authors do an amazing job of starting from familiar ideas and building up to surprisingly beautiful and elegant ideas.

    I think I’m finally able to grok c++ templates half way through this book.

    One unfortunate downside to this book is that the authors wrote this before concepts were introduced in c++20. I would love to see an updated edition of this book that use the real c++20 concepts. However, this doesn’t diminish my recommendation for this book.

  • by zzo38computer on 9/27/21, 12:42 AM

    I like "The Art of Computer Programming". It uses assembly language, which is one thing I like compared with other books, but there are other things I also like about this book compared with other ones too, I think it is better written.
  • by markus_zhang on 9/26/21, 2:59 PM

    Game programming patterns, Game scripting mastery
  • by icey on 9/26/21, 6:06 PM

    Programming Scala is one of the best programming books I’ve ever read. Scala never stuck with me, but I’ve gone through the book a couple of times because it’s so well written and enjoyable to read.
  • by neoncontrails on 9/28/21, 7:42 AM

    Bitwise: A Life in Code, by David Auerbach.

    Among its memorable conceits: debugging as a life-improvement strategy, the weirdly mesmerizing properties of randomness, adversarial cat-and-mouse games that have transpired as a result of dueling software programs. He's a gifted writer and one of the few to consider programming as somewhat spiritually connected to the question of what it means to be a human. (In addition to his literary credentials, the writer is a former technical lead at Microsoft and Google.)

  • by wly_cdgr on 9/26/21, 5:25 PM

    Bjarne Stroustrup's Programming - Principles and Practice Using C++. Unparalleled combination of real-world pragmatism and rigor. Plus, since you learn C++, this book prepares you better than most for more advanced books/courses on compilers, operating systems, computer architecture

    Hon. mentions: HtDP and accompanying Simple Data and Complex Data courses on edX; Part I of Sedgewick & Wayne's Computer Science book and accompanying booksite and free Coursera course

  • by ToFab123 on 9/27/21, 3:28 AM

    "Code Complete" by Steve McConnell https://en.wikipedia.org/wiki/Code_Complete

    For many years we gave this book to all new employees on day #1. Even the most experienced developers will find something in this book they will find very useful and it will help you to take a step back and evaluate your programming. This book is true gold mine.

  • by mkchoi212 on 9/26/21, 5:12 PM

    The Little Schemer is my favorite by far! so easy to understand and follow. Definitely a must read if you want to get into functional programming
  • by dperalta on 9/27/21, 3:21 PM

    I just started with: The Humble Programmer by Edsger W. Dijkstra and I'm lovin' it (not a book but a 15 pages essay).
  • by edrx on 9/29/21, 3:43 AM

  • by macando on 9/26/21, 7:07 PM

    Most influential - Clean Code and The Joy of C (the first programming book I've read)

    Most informative - Effective Java

    Funniest - Learn You a Haskell for Great Good!

    Best written - Eloquent Ruby

    Most useful - Data Modeling Essentials

  • by coder4life on 9/26/21, 6:15 PM

    "Enough rope to shoot yourself in the foot - rules for C and C++ programmers" by Alan C Holub.

    And "Compiler design in C", also by him

  • by heluser on 9/26/21, 9:40 PM

    - Low level: Code Complete 2 (yes it’s old but still very relevant) - Hight level: Designing data intensive applications
  • by m3talsmith on 9/26/21, 2:45 PM

    1. Why’s Poignant Guide to Ruby

    2. Practical Common Lisp

    3. A Programmer’s Introduction to Mathematics

    4. Data Structures and Programming Design in C

    5. The Art of Agent Oriented Modeling

  • by baash05 on 9/26/21, 10:19 AM

    "Clean code" is a top contender.
  • by karmakaze on 9/26/21, 6:32 PM

    There are many great ones listed here, but I wouldn't give any single book more credit than how they combine in practice, as the question sort of implies.

    The best lessons I've learned is how to balance all these good ideas for each problem, idea, implementation. How do do OO without lots of racy mutable state, using immutability efficiently, composing pure functions, identifying what to abstract explicitly vs allowing something to permeate, intention and priority when separating factors/aspects, good naming patterns and when to use which. I don't know of a book that tells you how to find balance.

  • by nandkunal on 9/26/21, 3:44 PM

    The Pragmatic Programmer