Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Paytload{} instead of buildPayload{} #278

Open
SPC-code opened this issue Oct 12, 2024 · 0 comments
Open

Use Paytload{} instead of buildPayload{} #278

SPC-code opened this issue Oct 12, 2024 · 0 comments

Comments

@SPC-code
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant