Skip to content

API Design Review: Varargs #686

@benjchristensen

Description

@benjchristensen

There is dislike of the multiple arities of from... especially how the 10-arity option always comes up and autocompletes first.

observablefrom

For history, changes from vararg to multiple arity overloads was done here: #361 and #359

An alternative is just accept from(Iterable<T>) and people call it as from(Arrays.asList(1, 2, 3, 4, 5)) which doesn't give the vararg warnings, but this is verbose.

On the flip side, the arities from 4-10 seem unnecessary and for "demo code" only.

Perhaps we deprecate the from(T, T, T) and higher arities? For higher we would use the from(Iterable<T>) solution?

Are there better ways?

/cc @headinthebox and @jhusain

NOTE: This affects from, merge, mergeDelayError and concat.

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