News for hackers. Stuff that matters.
Re:The Logical Disaster of Null by coldtea on Thursday May 10, 2018 @06:16AM (#17037603)
e.g:

  sum = 0
  for entry in entries:
    case (val):
      null: pass
      number n: sum += n
    endcase
in pseudocode. Several languages have offered this since forever (eg. Haskell and Maybe).

The fun part is that the typesystem enforces that you check all possible cases -- or only lets you explicitly un wrap potentially null values.

So it's not like a C programmer checking if (x == NULL) manually.

There are no comments on this comment yet.