Skip to content

Name of .sliding #23

@nicolo-ribaudo

Description

@nicolo-ribaudo

Sorry for giving this feedback so close to plenary.

I think that .windows and .sliding are both good names individually, but they are terrible names if we are going to have both methods.

Both methods are a "sliding window" over the underlying iterator, and neither name hints at how they are different. I understand that the .sliding name was chosen following Scala's precedent, but:

  • Scala doesn't have a .windows method, so there is no confusion there
  • Scala's .sliding docs literally mention "sliding window".

I would very much prefer the two methods to share the same prefix in the name, with a "modifier" that tells how they are different. Ideally, I'd start typing something in my editor and both would show up. Some ideas:

  • windows/windowAllowShorter
  • windows/windowOrShorter
  • windowsStrictSize/windows
  • windowsOrEmpty/windows
  • windowsTry/windows

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