Skip to content

AV1551 Call the most overloaded method from other overloads #20

@ygoe

Description

@ygoe

Do you have any explanation for this one?

This likely leads to duplicate code. You set the same default value in multiple overloads. Change one, forget the others (even though they're close to each other), and you have a problem. Your sample code would happily work if each overload only adds the next parameter and lets the other overloads add all other parameters. This way, you only add one parameter per overload and only have each value in a single place.

Obviously, if leaving out multiple parameters requires to set a number of different values, calling a longer overload is necessary. But that comes from a functional requirement.

I'd make the phrase about the order of parameters in all overloads the main point and leave out the rest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions