Skip to content

Rethinking method names for sample/population #2

@NathanJang

Description

@NathanJang

Have you considered using an enum or a boolean instead of 2 separate implementations for some methods?

For instance

public static func variance(values: [Double], type: DataType) -> Double? with DataType.Sample or something

or

public static func variance(values: [Double], isSample: Bool) -> Double?

and checking for it in the implementation instead of copy-pasting 2 very similar implementations.

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