Hacker News new | past | comments | ask | show | jobs | submit login

That is easy -- non nullable objects. What I mean by that is that you can already specify that some numbers may be nullable. I would love to be able to specify that some objects cannot be null and have the type-checker verify it.

Even better I would have an option type so that you never need to use null, ever.




They don't really work at the type system level, but Code Contracts (http://msdn.microsoft.com/en-us/devlabs/dd491992), though quite verbose, may be used to achieve that to a certain degree. The integration with Visual Studio is decent and the documentation is great, but they are designed to provide a whole design-by-contract framework which may be an overkill.


That's a good one, I'll keep that in mind. (I'm not just cribbing, I ran into a real world situation that just screamed non-nullable objects).


I remember Anders saying that that was one of his regrets for not implementing this from the beginning. According to him adding this now would break quite a few things, but he hasn't yet given up on the idea.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: