Reducing Assumptions, Exploding Your Code

16 points by refaktor


ryan-duve

I've been learning Erlang recently and it has a very similar happy-path-first approach:

  1. Begin to run your code in one process.
  2. Get to a point where you have to run error-prone code.
  3. Spawn that code out to a new process and wait for the response to return.
  4. Resume.

It's a bit more complicated than that, and there does exist a syntax like Python's try/except for synchronous code, but having the happy path uninterrupted while errors are caught by other processes has been a refreshing new take for me.