Remix.run Logo
int_19h an hour ago

> I personally like the behavior of coroutines not running unless you tell them to run -- it makes it easier to reason about what code runs when.

In .NET the difference was known as "hot" vs "cold" tasks.

"Hot" tasks - which is what .NET does with C# async/await - have one advantage in that they get to run any code that validates the arguments right away and fail right there at the point of the call, which is easier to debug.

But one can argue that such validation should properly be separate from function body in the first place - in DbC terms it's the contract of the function.