Skip to content

Use Paytload{} instead of buildPayload{} #278

@SPC-code

Description

@SPC-code

Functions like buildList were frequently used at the beginning of Kotlin, but it seems like nowadays it is much better to use fake constructors instead of top-level functions. So, I suggest adding a Payload{ } builder and deprecate buildPayload without changing its desgin.

Motivation

The only motivation for this change is discoverability. If you want to create Payload, you start typing Payload without looking into documentation for function. It is not possible to do that for List in the standard library because it would be ambiguous now, but for Payload it seems to be a good solution.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions