Skip to content

Split for other visibilities? #932

Closed as not planned
Closed as not planned
@oliviercailloux

Description

@oliviercailloux

Section 3.4.2.1 forbids to split overloads.

The rule makes perfect sense for user visible methods, but what about inserting an invisible one in between visible ones?

Consider this situation.

  • + m1(Integer param)
  • + m1(Float param)
  • + m1(Double param)
  • - m1NumericHelper()
  • + m1(String param)

Assume that m1NumericHelper() is a private helper method called by + m1(Integer param), + m1(Float param) and + m1(Double param) but not by + m1(String param). If a programmer likes to put such helper methods just after the ones that use them in general, it seems to make sense to also put this one just after these three methods.

It does not hurt usage as users will still see all (visible) methods grouped together.

Would the style guide admit an exception when private methods intervene in between public ones that share a name?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions