Skip to content

C# 8 nullable support #691

@jl0pd

Description

@jl0pd

What can we do to make ScottPlot better?

Consider adding nullable annotations as they will increase productivity of using library.
This will clarify what you may expect from function.

For example:

public static int[] RandomInts(Random rand, int pointCount, double multiplier = 1, double offset = 0)

Only those who read source code would know that they may pass null as first parameter

Or:

public double[] MinorFromMajor(double[] majorTicks, double minorTicksPerMajorTick, double lowerLimit, double upperLimit)

This may not be obvious that if you pass array with less than 2 elements it will return null

Is this breaking change?

No. Nullable annotation are not breaking existing code. Types remain same, but with some attributes, not changing behavior. It will work with .Net Framework, I've tested it with .Net Framework 4.0 and 4.6 in different projects

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