Hacker News new | ask | show | jobs
by acrive 3033 days ago
The state machine is very near at Design by contract pattern. There are states, preconditions and other stuff. The question now will be "Why developers never use design by contract pattern?" :)

https://github.com/nhatminhle/cofoja for example

1 comments

Design by contact is a lot more general. You can have preconditions and postconditions in stateless code. And statelessness is the best way to handle concurrency. When stateful and concurrent, you get to handle outdated requests intelligently and with as little blocking as possible.