Disclaimer: Desde que eu não conheço nenhum designer de linguagem pessoalmente, qualquer resposta que eu lhe der será especulativa.
De Tony Hoare :
I call it my billion-dollar mistake. It was the invention of the null reference in 1965. At that time, I was designing the first comprehensive type system for references in an object oriented language (ALGOL W). My goal was to ensure that all use of references should be absolutely safe, with checking performed automatically by the compiler. But I couldn't resist the temptation to put in a null reference, simply because it was so easy to implement. This has led to innumerable errors, vulnerabilities, and system crashes, which have probably caused a billion dollars of pain and damage in the last forty years.
Ênfase minha.
Naturalmente, não pareceu uma má idéia para ele na época. É provável que tenha sido perpetuado em parte pela mesma razão - se pareceu uma boa idéia para o inventor do quicksort, vencedor do Prêmio Turing, não é de surpreender que muitas pessoas ainda não entendam por que é mal. Também é provável, em parte, porque é conveniente que os novos idiomas sejam similares aos idiomas mais antigos, tanto por razões de marketing quanto por razões de aprendizado. Caso em questão:
"We were after the C++ programmers. We managed to drag a lot of them about halfway to Lisp." -Guy Steele, co-author of the Java spec
(Fonte: link )
E, é claro, C ++ tem nulo porque C tem nulo e não há necessidade de entrar no impacto histórico de C. C # tipo de substituído J + +, que foi a implementação da Microsoft de Java, e também é substituída C + + como a linguagem de escolha para o desenvolvimento do Windows, por isso poderia ter obtido de qualquer um.
EDIT Aqui está outra citação de Hoare que vale a pena considerar:
Programming languages on the whole are very much more complicated than they used to be: object orientation, inheritance, and other features are still not really being thought through from the point of view of a coherent and scientifically well-based discipline or a theory of correctness. My original postulate, which I have been pursuing as a scientist all my life, is that one uses the criteria of correctness as a means of converging on a decent programming language design—one which doesn’t set traps for its users, and ones in which the different components of the program correspond clearly to different components of its specification, so you can reason compositionally about it. [...] The tools, including the compiler, have to be based on some theory of what it means to write a correct program. -Oral history interview by Philip L. Frana, 17 July 2002, Cambridge, England; Charles Babbage Institute, University of Minnesota.[ http://www.cbi.umn.edu/oh/display.phtml?id=343]
Mais uma vez, ênfase minha. Sun / Oracle e Microsoft são empresas, e a linha inferior de qualquer empresa é dinheiro. Os benefícios para eles de ter null
podem ter superado os contras, ou eles podem simplesmente ter um prazo muito apertado para considerar completamente o problema. Como exemplo de um erro de linguagem diferente que provavelmente ocorreu devido a prazos:
It's a shame that Cloneable is broken, but it happens. The original Java APIs were done very quickly under a tight deadline to meet a closing market window. The original Java team did an incredible job, but not all of the APIs are perfect. Cloneable is a weak spot, and I think people should be aware of its limitations. -Josh Bloch
(Fonte: link )