Hacker News new | ask | show | jobs
by lock1 335 days ago
Maybe "Making illegal state unrepresentable" is the term you're looking for?

https://fsharpforfunandprofit.com/posts/designing-with-types... https://inside.java/2024/06/03/dop-v1-1-illegal-states/

IMO it's doesn't have much relation with dynamic programming though.

1 comments

It was mainly just one example of the thought pattern that I feel translates. In my head it has a relation. In dynamic programming, you compose a solution of smaller, but still valid solutions. When calculating fib(8), you can trust that combining fib(7) and fib(6) is valid, and so on down to the base case. If you apply that concept to other parts of programming, it's much easier to reason about.