3 ms·
The link to hexagonal architecture at the bottom is an important one. Colored functions are a good thing. In fact, just splitting based on red/blue for sync/as
by ItsMonkk 5y ago
The link to hexagonal architecture at the bottom is an important one.
Colored functions are a good thing. In fact, just splitting based on red/blue for sync/async doesn't go far enough. You also need to split based on pure/impure. Many times async are impure, but the reverse(sync being pure) is not at all guarenteed and the distinction is there.
The colored pain point that the original topic pointed out IS a good thing, if you don't have a direct dependency between the code that ran before the await and after the await, they should not be nested into the same layer. The thing that I think I've come to understand is that the typical call stack has way to many layers. Hexagonal Architecture together tracking async/sync and pure/impure leads to a pipeline of many functions at the top of the module, and this leads to better code.