Hacker News new | ask | show | jobs
by NetMonkey 5160 days ago
Basic types are optionally nullable. int? is nullable, int is not.

It is a fantastic tool in many cases where a null is much clearer than something like -1 to denote a missing value.

However, I can see the issue with some developers using nullable types for everything. But any sufficiently powerful/flexible tool is always going to be misused by some.

1 comments

I had the misfortune in the past to maintain C# code that kept everything as strings; whether it was an integer, a floating-point number, a guid, a date or a boolean. Lousy developers can abuse anything, in itself in my opinion this is not a reason to not have it included.

(I have a the same opinion about goto and operator overloading; clearly the folks at Microsoft agree with me here.)