frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Design Pressure: The Invisible Hand That Shapes Your Code

https://hynek.me/talks/design-pressure/
105•NeutralForest•7h ago

Comments

1317•5h ago
[video]
da39a3ee•5h ago
I'm not sure I'd take design advice from someone who thought attr.ib and attr.s were a good idea. On the other hand he points out that DDD is a vacuous cult, which is true.
skydhash•5h ago
DDD is nice especially in the first phase. All the concepts are actually rehashed from earlier principles. There’s nothing fully new there.
wilkystyle•5h ago
> I'm not sure I'd take design advice from someone who thought attr.ib and attr.s were a good idea

Can you elaborate?

hynek•30m ago
that's a reference to my attrs library which is what data classes are based on. It originally used

    @attr.s
    class C:
        x = attr.ib()
as its main api (with `attr.attrs` and `attr.attrib` as serious business aliases so you didn't have to use it).

That API was always polarizing, some loved it, some hated it.

I will point out though, that it predates type hints and it was an effective way to declare classes with little "syntax noise" which made it easy to write but also easy to read, because you used the import name as part of the APIs.

Here is more context: https://www.attrs.org/en/stable/names.html

I REGRET NOTHING

switchbak•1h ago
I’d call out patternitis and over-OOPification way before I’d criticize DDD. Yes, the latter can go too far, but the two former cases are abused on a much more frequent basis. Happily the pattern crazyness has died down a lot though.
g958198•5h ago
i've cultivated the perception of what op calls design pressure my whole career as the primary driver behind code and her shape. i think it's the most important aspect of a successful architecture, and it's purely intuition based, which is also why there's no silver bullet. i've seen people take most well intended best practices and drive them into the ground because they lack the design pressure sense.

i believe that design pressure sense is a form of taste, and like taste it needs to be cultivated, and that is can't be easily verbalized or measured. you just know that your architecture is going to have advantageous properties, but to sit down and explain why will take inordinate amount of effort. the goal is to be able to look at the architecture and be able to see its failure states as it evolves through other people working with it, external pressures, requirement changes, etc. over the course of 2, 3, ... 10, etc. years into the future. i stay in touch with former colleagues from projects where i was architect, just so that i can learn how the architecture evolved, what were the pain points, etc.

i've met other architects who have that sense, and it's a joy to work with them, because it is vibing. conversly "best practices or bust" sticklers are insufferable. i make sure that i don't have to contend with such people.

layer8•5h ago
This reminds me of the concept of “forces” [0][1][2] in design-pattern descriptions. To decide for or against the use of a given design pattern, or to choose between alternative design patterns, one has to assess and weigh the respective forces in the particular context where it is to be used. They are called forces because they collectively pull the design in a certain direction. Just a different physics analogy versus “pressure”.

[0] https://www.cs.unc.edu/~stotts/COMP723-s13/patterns/forces.h...

[1] https://www.pmi.org/disciplined-agile/structure-of-pattern-p...

[2] Chapter 19 in “Pattern languages of program design 2”, ISBN 0201895277

skydhash•5h ago
Code is for communicating with humans primarily, even though it needs to be run on a machine. All the patterns, principles, and best practices is to ease understanding and reasoning by other people, including your future self. Flexibility is essential, but common patterns and shared metaphors work wonders.
rowanG077•3h ago
That's terribly short sighted. You can have a very clear architecture and code which cannot support the use cases required without almost starting from scratch.
semicolon_storm•2h ago
You can also have the most flexible system ever designed, but if the rest of your team doesn't understand it then good luck implementing that required use cases
rowanG077•25m ago
Sure, both extremes are shortsighted. I wasn't arguing for that, to be clear. I'm just saying clarity and ivory tower architecturing has little value if your system can't actually support the intended use case.

Which is what the person I was replying to said with "Code is for communicating with humans primarily, even though it needs to be run on a machine.". If the primary purpose is communication with other humans we wouldn't choose such awkward languages. The primary purpose of code is to run and provide some kind of features supporting use cases. It's really nice however if humans can understand it well.

immibis•2h ago
That aphorism is completely incorrect. Code is primarily for communicating with a machine. If the purpose was to communicate with humans, we'd use human languages. Lawyers do that.

The code does also need to be understandable by other humans, but that is not its primary purpose.

skydhash•2h ago
So why do we have Java, Kotlin, Scala, Groovy, and Clojure, all targeting the JVM? And many such families?

The only thing that matter to the machine is opcodes and bits, But that's alien to human, so we map it to assembly. Any abstractions higher than that is mostly for reasoning about the code and share that with other people. And in the process we find some very good abstractions which we then embed into programming languages like procedure, namespacing, OOP, patterns matching, structs, traits/protocols,...

All these abstractions are good because they are useful when modeling a problem. The some are so good then it's worth writing a whole VM to get them (lisp homoiconicity, smalltalk's consistent world representation,...)

rowanG077•22m ago
Because a secondary goal of code is communication with other humans. That means readability is still a highly valuable trait. Just not as valuable as the primary purpose.
Mikhail_Edoshin•1h ago
I'd say code is a machine. Even code in a high-level language. Code machine is somewhat special because its details look like words. This misleads us into believing we can reason with these words. We cannot. We can use them to make the machine itself, but the only way to explain how it works is to write a normal technical description and the normal way to understand it should begin with reading that description. (There's no standard for a normal technical description though.)
necovek•1h ago
While you are obviously right about it not being the primary purpose, here it seems the discussion is about designing for long term maintainability vs just running code.
rowanG077•23m ago
The person he replied said code is primarily for communicating with other people. I'm not sure how else to interpret that than what is literally written down.
osigurdson•4h ago
Zen and Art of Motorcyle maintenance is a good reference.

Also, it is good to remember what game is actually being played. When someone comes up with a popularizes a given "best practice", why are they doing so? In many cases, Uncle Bob types are doing this just as a form of self promotion. Most best practices are fundamentally indefensible with proponents resorting to ad-hominem attacks if their little church is threatened.

loevborg•3h ago
Great talk, there's a lot I can relate to in here.

I find this topic difficult to navigate because of the many trade-offs. One aspect that wasn't mentioned is temporal. A lot of the time, it makes sense to start with a "database-oriented design" (in the pejorative sense), where your types are just whatever shape your data has in Postgres.

However, as time goes on and your understanding of the domain grows, you start to realize the limitations of that approach. At that point, it probably makes sense to introduce a separate domain model and use explicit mapping. But finding that point in time where you want to switch is not trivial.

Should you start with a domain model from the get-go? Maybe, but it's risky because you may end up with domain objects that don't actually do a better job of representing the domain than whatever you have in your SQL tables. It also feels awkward (and is hard to justify in a team) to map back and forth between domain model, sql SELECT row and JSON response body if they're pretty much the same, at least initially.

So it might very well be that, rather than starting with a domain model, the best approach is to refactor your way into it once you have a better feel for the domain. Err on the side of little or no abstraction, but don't hesitate to introduce abstraction when you feel the pain from too much "concretion". Again, it takes judgment so it's hard to teach (which the talk does an admirable job in pointing out).

bubblyworld•3h ago
Pretty naive question, but what differentiates a "domain model" from these more primitive data representations? I see the term thrown around a lot but I've never been able to grok what people actually mean.

By domain model do you mean something like what a scientist would call a theory? A description of your domain in terms of some fundamental concepts, how they relate to each other, their behaviour, etc? Something like a specification?

Which could of course have many possible concrete implementations (and many possible ways to represent it with data). Where I get confused with this is I'm not sure what it means to map data to and from your domain model (it's an actual code entity?), so I'm probably thinking about this wrong.

metayrnc•2h ago
For me domain model means capturing as much information about the domain you are modeling in the types and data structures you use. Most of the time that ends up meaning use Unions to make illegal states unrepresentable. For example, I have not seen a database native approach to saving union types to databases. In that case using another domain layer becomes mandatory.

For context: https://fsharpforfunandprofit.com/posts/designing-with-types...

skydhash•2h ago
A quick example can be found with date. You can store it in ISO 8601 string and often it makes more sense as this is a shared spec between systems. But when it comes to actually display it, there's a lot of additional concerns that creep in such as localization and timezones. Then you need to have a data structure that split the components, and some components may be used as keys or parameters for some logic that outputs the final representation, also as a string.

So both the storage and presentation layer are strings, but they differs. So to reconcile both, you need an intermediate layer, which will contains structures that are the domain models, and logic that manipulate them. To jump from one layer to another you map the data, in this example, string to structs then to string.

With MVC and CRUD apps, the layers often have similar models (or the same, especially with dynamic languages) so you don't bother with mapping. But when the use cases becomes more complex, they alter the domain layer and the models within. So then you need to add mapping code. Your storage layers may have many tables (if using sql), but then it's a single struct at the domain layer, which then becomes many models at the presentation layer with duplicate information.

NOTE

That's why a lot of people don't like most ORM libraries. They're great when the models are similar, but when they start to diverge, you always need to resort to raw SQL query, then it becomes a pain to refactor. The good ORM libraries relies on metaprogramming, then they're just weird SQL.

groone•47m ago
ORM libraries have Value conversion functionality for such trivial examples https://learn.microsoft.com/en-us/ef/core/modeling/value-con...
Noumenon72•3h ago
There was a comment on here saying this was an implied diss of SQLModel, but now that I came back to reply to it it's gone. Weird. Since it's implied I couldn't find it in the slides.
vinipolicena•3h ago
Parts of the talk remind me of https://www.amundsens-maxim.com/
knallfrosch•2h ago
I had the reverse problem a month ago. Greenfield project without existing data, domain model or API. I had no reason to model the API or persistence layer any different than the domain model, so I implemented the same class 3 times, with 2 mappings on top. For what? Well at some point, you will have API consumers and existing data and you need to be able to change the then-existing system.
leecommamichael•2h ago
Interesting, perhaps modern conveniences encourage coupling.

No wonder there are so many single-monitor, no-LSP savants out there.

Plwm – An X11 window manager written in Prolog

https://github.com/Seeker04/plwm
86•jedeusus•3h ago•12 comments

Lottie is an open format for animated vector graphics

https://lottie.github.io/
197•marcodiego•6h ago•81 comments

Path to a free self-taught education in Computer Science

https://github.com/ossu/computer-science
89•saikatsg•3h ago•45 comments

Writing your own CUPS printer driver in 100 lines of Python (2018)

https://behind.pretix.eu/2018/01/20/cups-driver/
104•todsacerdoti•5h ago•8 comments

Lisping at JPL (2002)

https://flownet.com/gat/jpl-lisp.html
70•adityaathalye•3d ago•14 comments

Ask HN: What are you working on? (May 2025)

25•david927•1h ago•66 comments

Writing a Self-Mutating x86_64 C Program (2013)

https://ephemeral.cx/2013/12/writing-a-self-mutating-x86_64-c-program/
52•kepler471•4h ago•16 comments

Claude 4 System Card

https://simonwillison.net/2025/May/25/claude-4-system-card/
487•pvg•14h ago•192 comments

Beware the Complexity Merchants

https://chrlschn.dev/blog/2025/05/beware-the-complexity-merchants/
29•kiyanwang•1h ago•13 comments

Show HN: Zli – A Batteries-Included CLI Framework for Zig

https://github.com/xcaeser/zli
36•caeser•4h ago•10 comments

Design Pressure: The Invisible Hand That Shapes Your Code

https://hynek.me/talks/design-pressure/
105•NeutralForest•7h ago•28 comments

Show HN: DaedalOS – Desktop Environment in the Browser

https://github.com/DustinBrett/daedalOS
73•DustinBrett•4h ago•15 comments

Koog, a Kotlin-based framework to build and run Al agents in idiomatic Kotlin

https://github.com/JetBrains/koog
14•prof18•3d ago•0 comments

Martin (YC S23) Is Hiring Founding AI/Product Engineers to Build a Better Siri

https://www.ycombinator.com/companies/martin/jobs
1•darweenist•4h ago

Denmark to raise retirement age to 70

https://www.telegraph.co.uk/world-news/2025/05/23/denmark-raise-retirement-age-70/
169•wslh•4h ago•392 comments

CAPTCHAs are over (in ticketing)

https://behind.pretix.eu/2025/05/23/captchas-are-over/
70•pabs3•20h ago•68 comments

Show HN: SVG Animation Software

https://expressive.app/expressive-animator/
148•msarca•9h ago•58 comments

'Strange metals' point to a whole new way to understand electricity

https://www.science.org/content/article/strange-metals-point-whole-new-way-understand-electricity
81•pseudolus•7h ago•24 comments

Wrench Attacks: Physical attacks targeting cryptocurrency users (2024) [pdf]

https://drops.dagstuhl.de/storage/00lipics/lipics-vol316-aft2024/LIPIcs.AFT.2024.24/LIPIcs.AFT.2024.24.pdf
78•pulisse•9h ago•55 comments

What happens after you run Git push?

https://www.blacksmith.sh/blog/security
5•tsaifu•2d ago•0 comments

Can a corporation be pardoned?

https://papers.ssrn.com/sol3/papers.cfm?abstract_id=5202339
33•megamike•4h ago•54 comments

Tariffs in American History

https://imprimis.hillsdale.edu/tariffs-in-american-history/
55•smitty1e•1d ago•82 comments

Is TfL losing the battle against heat on the Victoria line?

https://www.swlondoner.co.uk/news/16052025-is-tfl-losing-the-battle-against-heat-on-the-victoria-line
51•zeristor•12h ago•70 comments

On File Formats

https://solhsa.com/oldernews2025.html#ON-FILE-FORMATS
97•ibobev•4d ago•58 comments

Dependency injection frameworks add confusion

http://rednafi.com/go/di_frameworks_bleh/
75•ingve•13h ago•81 comments

Programming on 34 Keys (2022)

https://oppi.li/posts/programming_on_34_keys/
48•todsacerdoti•8h ago•67 comments

Reinvent the Wheel

https://endler.dev/2025/reinvent-the-wheel/
549•zdw•1d ago•209 comments

Now you can watch the Internet Archive preserve documents in real time

https://www.theverge.com/news/672682/internet-archive-microfiche-lo-fi-beats-channel
95•LorenDB•2d ago•9 comments

Show HN: AI Baby Monitor – local Video-LLM that beeps when safety rules break

https://github.com/zeenolife/ai-baby-monitor
59•zeenolife•4d ago•44 comments

The Newark airport crisis

https://www.theverge.com/planes/673462/newark-airport-delay-air-traffic-control-tracon-radar
82•01-_-•3h ago•60 comments