What programming language first used / invented the 'Safe navigation operator' (?.) ?

Unfortunately, the Wikipedia page on this subject does not have information on it and googling yielded no readily available answer.

  • While I find this question personally interesting, I'm not sure it's on-topic here as it is more about PL history than about software engineering concepts (see also our help center). This is also something you could research yourself: start with the list of languages with this feature, then search the discussions/change proposals/RFCs that lead to the inclusion of that syntax into the language. Most language features are explicitly borrowed from other languages; individual features are rarely entirely novel. At the very least, demonstrating some research would make answers easier. – amon Aug 2 '17 at 19:16
  • 3
    AFAIK, Groovy was the first language to use this operator. It was present in v1, released in 2007. However, having said that, I'm sure someone will now pop up and point out some other language had it before then :) – David Arno Aug 2 '17 at 20:24
  • Safe navigation operator is nice, but even better would have been better support for never-null object references -- these are references that can never be null, enforced by the compiler, not the run-time. Then the operator would not be needed as frequently. – Frank Hileman Aug 12 '17 at 0:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.