Would that we could all just up and switch programming languages at the drop of a hat like that.
Explicitly defining what is ever allowed to be 'null' is a great habit that serves me extremely well during evenings and weekends. But it's completely useless to me, by virtue of being impossible, between 9am and 5pm.
Value types are non-nullable. But they're also stack-allocated* and passed by value, so they're really only appropriate in certain cases. You can't use them as general-purpose non-nullable objects.
*In practice, though technically that bit's an implementation detail of Microsoft's run-time and not part of the language spec.
Isn't it just an specific formulation of Murphy's Law? If something can go wrong it will. And that is not just the golden rule of programming, it's the golden rule of Life!
[+] [-] jconnop|13 years ago|reply
Cached version: http://webcache.googleusercontent.com/search?q=cache:vyvuBLO...
[+] [-] pbosko|13 years ago|reply
[+] [-] damncabbage|13 years ago|reply
So explicitly define what is allowed to ever be "null": http://lukeplant.me.uk/blog/posts/null-pointers-vs-none-vs-m...
[+] [-] bunderbunder|13 years ago|reply
Explicitly defining what is ever allowed to be 'null' is a great habit that serves me extremely well during evenings and weekends. But it's completely useless to me, by virtue of being impossible, between 9am and 5pm.
[+] [-] ciupicri|13 years ago|reply
[+] [-] yen223|13 years ago|reply
[+] [-] spo81rty|13 years ago|reply
[+] [-] gnuvince|13 years ago|reply
[+] [-] adamtulinius|13 years ago|reply
And here comes a repetition of Maybe Foo in haskell, and Option in Scala/Java. Hehe :-)
[+] [-] 3amOpsGuy|13 years ago|reply
Keep meaning to try C# for a project sometime. I understand it to be a more expressive, programmer friendly Java.
[+] [-] bunderbunder|13 years ago|reply
*In practice, though technically that bit's an implementation detail of Microsoft's run-time and not part of the language spec.
[+] [-] spo81rty|13 years ago|reply
[+] [-] PuercoPop|13 years ago|reply
[+] [-] spo81rty|13 years ago|reply
[+] [-] shuma|13 years ago|reply
[+] [-] GiraffeNecktie|13 years ago|reply
[+] [-] MJR|13 years ago|reply