Skip to content

Surely more justification needed, against existing alternative patterns!? #2

@TheNavigateur

Description

@TheNavigateur

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions