Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Courses explaining well-written codebases?
113 points by akudha on July 30, 2022 | hide | past | favorite | 24 comments
There are thousands of courses teaching people programming - some of these have become big businesses (plural sight, educative etc). But most of these are aimed at beginners. Some intermediate at best.

Are there courses that take well architected, well written codebases and explain the design principles, coding principles etc of such codebases?




I always recommend The Architecture of Open Source Applications [0], it contains some really interesting stories. And it’s free!

[0] http://aosabook.org


This is the best one I've seen, thanks for the reminder.


I’d come across https://codecatalog.org. I wish there were more of these kind of resources.


This is really nice, thank you for sharing!


We're trying out a series at Sourcegraph doing walkthroughs and deep-dives into popular open-source projects:

1. How Caddy web server works: https://sourcegraph.com/notebooks/Tm90ZWJvb2s6MTM2Nw==

2. How TypeScript ESLint works: https://sourcegraph.com/notebooks/Tm90ZWJvb2s6MTA2OA==

The goal is to write these as if we were onboarding new contributors to the codebase. If there are maintainers of projects that'd like to be featured, please hit us up: https://discord.gg/SQCbGe6zTn. And you can subscribe here: https://tourdesource.substack.com.


I started reading this book, but lost interest pretty quickly. Maybe you'll like it if you give it a shot: https://www.amazon.com/Code-Reading-Open-Source-Perspective/...

Effective Java by Joshua Bloch has code snippets that are very well-written, as are the examples in The Go Programming Language by Donovan et. al. I read practically all the code in Effective Java, and a lot of the examples in The Go Programming Language (I keep dipping into this book every now and then as I have to learn some aspect of Go, which I use at work; I think I may actually sit down and read this book cover-to-cover and perhaps play with most of the examples).

If you know C, you may want to give the examples in The C Programming Language by Kernighan et. al a go. The examples are written in a bit of an archaic dialect but still very clear.

Another book of note that is funny and engaging (but of course not something that has professional value) is If Hemingway Wrote Code by Angus Croll: https://nostarch.com/hemingway. I think I have read all of the code in this book.


I like “Effective Python” similarly, though its more about micro codebase decisions than macro (architecture) decisions.


"Operating Systems: Design and Implementation" is a classic book that was walks through Minix. It was a commonly used as a follow up course with projects to modify its code. Due to the author wanting to keep it dedicated towards education rather than real systems, it did not become a professional project but did inspire Linux' creation. There are similar books for other OSes, such as BSD and Solaris.

A broader but less detailed approach for casual readers are the books "Beautiful Code" and "The Architecture of Open Source Applications".


also "lions commentary on unix" does the same, but with 6th edition unix if you're feeling like a "great books" approach to operating system software design.


I second "Beautiful Code" it's a book I bought years ago but still browse through from time to time.


> well architected, well written codebases

Not a lot of that, tbqh.

Check the PostgreSQL codebase. One of the cleanest big codebases around. Here's a list of resources for devs: https://wiki.postgresql.org/wiki/Developer_FAQ#What_informat...

Also, what are your goals? Understanding ugly written, barely working, and badly designed codebases is a much more useful skill.


Course? Like with lectures and work? The only one I know that does it is the premium course at https://watchandcode.com/ where the premium's focus is teaching students how to read (javascript) codebases. They start you with a small library then you graduate to exploring increasingly complex open source codebases, along the way picking up concepts in computer science and javascript. It has a heavy focus on contributing to open source, advanced students are working on open source projects such as those from Mozilla. It uses javascript though, so if that's not your cup of tea, then your best bet are blog posts and books, such as

- xv6: https://pdos.csail.mit.edu/6.S081/2021/xv6/book-riscv-rev2.p...

- tensorflow (google translate can do PDFs): https://github.com/horance-liu/tensorflow-internals


Niklaus Wirth is the creator of the languages Pascal, Modula-2 and Oberon. Wirth used Oberon to write a complete desktop computer system, documenting the software design of the system in a freely available book. The Project Oberon website succinctly describes the project:

"Project Oberon is a design for a complete desktop computer system from scratch. Its simplicity and clarity enables a single person to know and implement the whole system, while still providing enough power to make it useful and usable in a production environment. This website contains information and resources for exploring and using the system. The project is fully described in Project Oberon: The Design of an Operating System, a Compiler, and a Computer — written by the designers, Niklaus Wirth and Jürg Gutknecht."

http://www.projectoberon.com/


I think Sourcegraph had a written series on this, can't remember the name.


We recently launched a newsletter called Tour de Source that dives into the source code of open source projects and how they work. So far we have Caddy and TS ESLint and a few in the pipe.

https://tourdesource.substack.com/


a lot of gnu software is excellent to read, although sometimes portability concerns can obfuscate it a bit.

codebases written in functional languages are also good. in general, when there's a higher barrier to entry, higher quality work is more prevalent.

consider spending some time teaching yourself how to find the best codebase that solves a particular problem. not only does that give you leverage for more learning down the line, it also helps you to develop the much more directly valuable skill of selecting good technology (and detecting crap before it's too late).


Build your own text editor: https://viewsourcecode.org/snaptoken/kilo/index.html. It goes through antirez's (creator of redis) kilo codebase.

Here is a list of similar tutorials from the same blog: https://viewsourcecode.org/snaptoken/similarTutorials.html


Check out PBRT, an academy award winning book about a rendering codebase!

https://pbrt.org/


I'd be more interested in a course focused on the history of the development of a real software product from the industry.


We once had a reading club at Google on the “Beautiful Architecture” book. I didn’t necessarily agree with all the claims of beauty, so it was nice to read it in a book club setting. Beauty is in the eye of the maintainer! :)


How did the book club work? Was it similar to non tech book clubs? Wondering if people would be interested in something like this over Zoom :)


We'd designate a chapter to read and meet up to discuss it. I imagine you could find enough interest on HN for a Zoom version! The hard thing is the attrition over time as folks get busy, but such is life. I can't do book club these days as I'm occupied with young kids, sadly.


It would be nice to see more software project case studies as a genre.


There’s no such thing as a well written codebase. There’s only code you wish you wrote and actual code that is deployed to production.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: