you are viewing a single comment's thread
view the rest of the comments
[–] 4 points 2 years ago* (2 children)

with this in mind

With what in mind? Evading NULL?

Languages that make use of references rather than pointers don't have this Dualism. C# has nullable references and nullability analysis, and null as a keyword.

What does your reasoning mean in that context?

  • source
  • parent
  • hideshow 4 child comments
  • [–] 5 points 2 years ago* (last edited 2 years ago)

    Languages that make use of references rather than pointers don’t have this Dualism.

    It's not about references vs pointers. You could easily have a language that allowed "null references" (edit: too much C++; of course many languages allow null references, e.g. Javascript) or one that properly separated null pointers out in the type system.

    I agree with your point though, using a special Null value is usually worse than using Option or similar. And nullptr_t doesn't help with this at all.

  • source
  • parent
  • [–] [S] 0 points 2 years ago (1 child)

    With what in mind? Evading NULL?

    Depends on your perspective. It's convenient to lean on type checking to avoid a whole class of bugs. You can see this either as avoiding NULL or use your type system to flag misuses.

    Languages that make use of references rather than pointers don’t have this Dualism. C# has nullable references and nullability analysis, and null as a keyword.

    C#'s null keyword matches the monadic approach I mentioned earlier. Nullable types work as a Maybe monad. It's the same concept shoehorned differently due to the different paths taken by these languages.

  • source
  • parent
  • hideshow 2 child comments