Questions tagged [nullability]

For questions about nullability of references or pointers in programming language, or having a type qualifier for pointer or reference types which specify whether they can be null or not, in order to improve reliability or efficienct by clarifying when null checks are required or not.

Filter by
Sorted by
Tagged with
31 votes
7 answers

Why does SQL treat null = null as null, unlike all other mainstream programming languages where null = null is true?

In SQL, equality involving null always returns null regardless of the other operand; for example, all of the following evaluate ...
Michael Tsang's user avatar
14 votes
7 answers

What are the pros and cons of an Option type in comparison to nullable types?

There seem to be two main ways that languages handle the same concept: Nullable types, like Kotlin, C#, and many other OOP languages Options, like Rust and Haskell,...
Rydwolf Programs's user avatar
14 votes
1 answer

What language was the first to treat null checks as smart casts to non-nullable types?

As far as I know, for many decades, in mainstream programming languages, there were only two options to handle null-like optionality: Pointer or reference types are always nullable (the famous "...
Eldritch Conundrum's user avatar
6 votes
2 answers

Are there any benefits to an Option type in a dynamically-typed language?

Going off of this question about the difference between nullable types and optional types, I notice that no mainstream dynamically typed language has ever gone for an explicitly-boxed ...
Silvio Mayolo's user avatar
5 votes
1 answer

How could I implement a non-null pointer qualifier in a C-style language?

In C currently, pointers just are, and there are no qualifiers to tell programmers whether they can be null or not. Objective-C kind of solves this problem by adding ...
CPlus's user avatar
  • 7,861
0 votes
3 answers

Should a REPL show null values as null? [closed]

I'm working on a REPL for a language that has a null value, and I'm not sure how to represent it in the output. The behavior of existing REPLs seems to be either to represent it by its name (...
Ginger's user avatar
  • 2,599