|
|
|
|
|
by lofenfew
672 days ago
|
|
>We literally exchanged callback hell to async hell, and said it was better, but I'm not strictly convinced of this. It's obviously better. It's a bit unfortunate how much the history of the design decision shines through in the current solution, but it's unequivocally an improvement. I would prefer an approach where calls to "async" functions are implicitly awaited unless a keyword turns then into a promise, and all functions are implictly treated as async as needed, unless a keyword specifies that they return a promise, which should be awaited instead. This would make the majority case clearer, and force you to make the minority case explicit where it's currently implicit. I don't think this would help your coworkers who don't understand promises very much though. |
|
> I would prefer an approach where calls to "async" functions are implicitly awaited unless a keyword turns then into a promise, and all functions are implictly treated as async as needed, unless a keyword specifies that they return a promise, which should be awaited instead. This would make the majority case clearer, and force you to make the minority case explicit where it's currently implicit.
This is a very interesting idea and feels good in an initial 'gut check' sense.