Ask HN: Best codebases to study to learn software design?
11–20 of 94 posts
Re: Ask HN: Best codebases to study to learn software design?
#12https://www.postfix.org/OVERVIEW.html
You might need to know a bit about how email servers work to appreciate it though.
Re: Ask HN: Best codebases to study to learn software design?
#13The decisions to exclude complexity, avoid premature abstractions, or reject certain patterns are often just as valuable as the code you can see. But when you're studying a codebase, you're essentially seeing the final edit without the editor's notes - all the architectural reasoning that shaped those choices is invisible.
This is why I've started maintaining Architectural Decision Records (ADRs) in my projects. These document the "why" behind significant technical choices, including the alternatives we considered and rejected. They're like technical blog posts explaining the complex decisions that led to the clean, simple code you see.
ADRs serve as pointers not just for future human maintainers, but also for AI tools when you're using them to help with coding. They provide readable context about architectural constraints and compromises - "we've agreed not to do X because of Y, so please adhere to Z instead." This makes AI assistance much more effective at respecting your design decisions rather than suggesting patterns you've deliberately avoided.
When studying codebases for design patterns, I'd recommend looking for projects that also maintain ADRs, design docs, or similar decision artifacts. The combination of clean code plus the architectural reasoning behind it - especially the restraint decisions - provides a much richer learning experience.
Some projects with good documentation of their design decisions include Rust's RFCs, Python's PEPs, or any project following the ADR pattern. Often the reasoning about what not to build is more instructive than the implementation itself.
Re: Ask HN: Best codebases to study to learn software design?
#14Re: Ask HN: Best codebases to study to learn software design?
#15Re: Ask HN: Best codebases to study to learn software design?
#16https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...
Re: Ask HN: Best codebases to study to learn software design?
#17My suggestion is to search for open-source codebases in your favorite languages, study them, and start practicing them.
Or maybe open source projects are all usually well designed. I haven't looked at many in depth. The only one I've really looked into was Clang to try to figure out why clang format ignored my style rules when styling files of certain names. (Turns out there is a list of file names that automatically are considered Objective-C rather than C++)
Re: Ask HN: Best codebases to study to learn software design?
#18My immediate reaction to this question is: "your team's". Nothing will teach you more about how to design software then really understanding why good and bad solutions were adapted to solve a certain real problem. Software exists precisely because there is still a messy layer connecting user requirements to actions on a computer. If there was not messiness then we could just automate it all. Approaching software from…
What if the question is asked by a college student?
Re: Ask HN: Best codebases to study to learn software design?
#19While studying well-designed codebases is incredibly valuable, there's an important "tip of the iceberg" effect to consider: much of good software design lives in the "negative space" - what's deliberately not there. The decisions to exclude complexity, avoid premature abstractions, or reject certain patterns are often just as valuable as the code you can see. But when you're studying a codebase, you're essentially s…
Re: Ask HN: Best codebases to study to learn software design?
#20I can recommend reading about postfix architecture if you want to learn a bit about what would nowadays be called a microservice architecture: https://www.postfix.org/OVERVIEW.html You might need to know a bit about how email servers work to appreciate it though.