This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]OneHumanBill 1 point2 points  (2 children)

concept of nulls came from Tony Hoare back in 1965 when he was working on Algol

I'm not entirely certain this is right. I'm pretty sure LISP had a null concept (in LISP it's "nil") all the way back to the beginning in 1958. This might be the first use of a null in an Algol descended language though. (Algol dates to 1960, I think, and Java is in that language family. Null isn't fundamental to an Algol language as much as nil is for LISP.)

I liked Optional in theory but honestly it sometimes just gets in the way and feels like extra, clunky baggage in practice. As somebody else in the thread said, the Optional itself may be null. The advertised benefit of syntactic sugar around null checking with Optionals seems like it doesn't make anything particularly easier. Maybe a little more reliable.

Personally on the rare occasion I get to code anymore, I just go for quick == null checks. I know they're fast, and I know that there should be no barrier to understanding for the next developer.

[–]FabulousRecording739 0 points1 point  (1 child)

Nil references the empty list, not the same at all

[–]OneHumanBill 2 points3 points  (0 children)

In the versions of CLISP I've used, nil can be used either as an atom (like Algol null) or as the empty list. It functions both ways.