Live data from Hacker News

Ask HN: Best codebases to study to learn software design?

news.ycombinator.com

81–90 of 94 posts

Re: Ask HN: Best codebases to study to learn software design?

#81
post #52

Earlier quoted context omitted.

> for me it seems like you have to actually run into problems over and over and figure out how to avoid the problems This shows how immature the field of software engineering is. Imagine bridges or houses were built like that. Or your surgeon was trained like that. Over time, we hopefully develop estblished norms, but at the moment, things are too much in flux. Put 5 sw engineers in a room, pose a problem and you wil…

> Imagine bridges or houses were built like that. Bridge building is a lot more conservative when it comes to taking risk in the construction, but that is how we build bridges and lots of bridges collapse because of similar causes: - Design Deficiencies - Construction Mistakes - Maintenance Issues - etc. An average of 128 bridges collapse annually in the United States. More than 17,000 bridges in America are consider…

Engineering doesn't mean all processes are flawless and surely not that all humans participating are perfect.

The collapsing bridges in the US are mainly caused by insufficient maintenance, which is not an engineering problem but a political one. And the vast majority of collapses happens with bridges that are known to be unstable and already blocked for traffic. The engineering part did that, as if it screams "told you so" at the politics which doesn't allocate sufficient funds for maintenance.

Re: Ask HN: Best codebases to study to learn software design?

#82

Earlier quoted context omitted.

> for me it seems like you have to actually run into problems over and over and figure out how to avoid the problems This shows how immature the field of software engineering is. Imagine bridges or houses were built like that. Or your surgeon was trained like that. Over time, we hopefully develop estblished norms, but at the moment, things are too much in flux. Put 5 sw engineers in a room, pose a problem and you wil…

> This shows how immature the field of software engineering is. Imagine bridges or houses were built like that. You're forgetting a key difference between software and the physical world. The blessing and curse of software is that there are few constraints on the solution so it can take an enormous number of different forms and still be valid. There isn't gravity, friction or the various other things that constrain p…

I agree with your assessment and didn't say it's easy. If it was then we'd already have solved it.

But that doesn't mean it can't be solved. I'm sure 150 years ago people said something similar about flight. Not a great analogy, but the point stands that if we keep working on it and have a goal then in a few decades we could get closer to actual engineering than the mess we are in today.

Re: Ask HN: Best codebases to study to learn software design?

#83
post #32

Trying to learn software design by looking at code is kind of like trying to learn about architecture looking at the bricks that make up a building. To learn about design you need a wider perspective. You can theoretically learn it from code but it won’t be most effective. Look at great documentation and literature about design instead.

Yeah, I guess without the context I wouldn't really understand why it was designed that way. Or know what situations a design like that would be good for. Is there any documentation or literature that has helped you?

Once upon a time there was an email MTA (email server) called qmail. It had an architecture that was surprising and Daniel Bernstein documented his philosophy. It left an impact on me by showing me how we can rely on the OS-supplied facilities to accomplish a lot. I don't think qmail is some shining star that will teach you everything you need to know about software design. It is an interesting case study to add to your repertoire.

See https://en.wikipedia.org/wiki/Qmail

Re: Ask HN: Best codebases to study to learn software design?

#85
The MIT course for Operating Systems has a teaching OS called xv6. There's some nifty implementations in there. I'm not sure I'd comment on the codebase itself, but I think more importantly it teaches you good abstractions which Unix is all about: https://pdos.csail.mit.edu/6.1810/2024/xv6.html

Re: Ask HN: Best codebases to study to learn software design?

#86
Start with the question: what is the problem that you want to solve? Next, find codebases that solve that problem and study how they do it.

Good design is so deeply tied to the domain details. Wonham's Internal Model Principle applies to code.

Example: I wanted to solve the problem of unit testing for embedded targets. I found open source projects that do this and read the code critically to see how and why it is written. As I build my own approach, I revisit theirs to learn more as my understanding of the domain deepens.

Post reply on HN