-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Bluntly, I dislike this whole idea quite intensely.
My reason is as follows:
New features should reduce the chances of bugs. I think this feature increases the surface area for bugs.
Reason: inconsistency between async vs sync classes can lead to mistaken usage in either case!
Leaving the reasons there for now:
On the issue of alternative patterns that already exist, I like to do this:
const
x = new SomethingWithAsyncProcessUponConstruction(),
asyncResult = await x.theAsyncThingImWaitingToGet
;
//
class SomethingWithAsyncProcessUponConstruction {
theAsyncThingImWaitingToGet = this.kickOffTheAsyncProcess();
async function kickOffTheAsyncProcess(){
//
}
}I think this preserves the strong consistency of classes, making them more dependable, manageable and predictable than if that were broken. Also, I don't find doing this inconvenient whatsoever. Also, in many respects, I find it easier to understand than the proposed idea. So therefore, it is really unclear to me what is being gained by it. But I do see what I regard as being lost by it, and I regard it as significant.