Live data from Hacker News

Learning Software Architecture

matklad.github.io

131–133 of 133 posts

Re: Learning Software Architecture

#131

I'll give you the cheat sheet: - Good design is a single idea pervaded throughout. - More generally, your goal should be to minimize surprise. - If your system allows it, people will do it. - Everyone will not just. If your solution starts with "if everyone will just..." then you don't have a solution. - Isolate the parts of your system that transform data from the ones that use it. Data models outlive code. - Coupli…

I don't agree with all of these, but I'll add a couple of my own: - The ultimate goal of software is to solve the immediate problem at hand. The secondary goal of software is to solve likely future problems with as little work as possible. Any bad design which is better on those goals than a good design is actually a good design. - Make your interfaces easy to use correctly and hard to misuse. Think of how people unf…

> - Don't repeat yourself; when it comes to data. If you store a single fact in multiple places; those places will inevitably get out of sync, and that causes bugs.

I find this principle to hold only superficially, and once subjected to scrutiny it breaks down.

There is a reason why Don't Repeat Yourself (DRY) was superceded by Write Everything Twice (WET). There were far too many junior devs swearing nonsense such as how a DRY abstract class that is inherited by two concrete classes is simpler than two classes or even functions that do mostly the same thing. These junior devs rolled out convoluted abstraction layers in name of DRY that would make enterprise code blush. Moreover, these simplistic yet fundamentalist DRY tricks introduced coupling between components that are similar at a superficial level but semantically held no relationship.

Instead of rolling out premature abstractions, code must allow duplications. Copying a class poses a far lower risk than dumping a sea of inheritance with a bunch of abstract classes and interfaces and generics. The job of a software architect is to save developers from themselves, and minimizing code is such a way.

Re: Learning Software Architecture

#132

Earlier quoted context omitted.

Good list! One addition? * start with a modular monolith

This one has yet to enter my head. I read Martin Fowler's related article* a few times, and it is sound... But I still can't see microservices being so "complex" to be so avoided early on. Especially in 2026, with the level of IaC and pipelines we have. I might be naïve, but I just don't get it. (*) https://martinfowler.com/bliki/MonolithFirst.html

It depends on your workload etc - but there are TONs of advantages for the monolith approach when you factor in dev environments, access to good data for testing/development, dependencies on components/libraries/services etc.

Note: I'm saying microservices CAN be the right answer, just not always and we should over-engineering.

sauce: I work as a product engineer where we use microservices extensively. I have also worked on monoliths. Preferred working on the monoliths overall I think.

Re: Learning Software Architecture

#133

Earlier quoted context omitted.

I'd add - data migrations are inevitable and should be planned for (corollary of versioning) - planning is good, sometimes you just have to try things out - everything costs money. Designing without costs in mind will force hard choices down the line

I'll add another to that: - Code lives longer than you expect. You forget sooner than you expect. Make a readme/architecture overview/theory of operation document. Put more in it than you think is needed. Check it in with the code.

This is one usecase where I'm thankful for AI: to help generate a bunch of documents in a well structured manner (giving it audience, having it scan through my comments on why I did xyz, etc)
Post reply on HN