Re:.NET Framework Version Comparision
by gouranga on Tuesday May 01, 2012 @05:46AM
(#3913615)
Agreed, apart from nullable types which I think is a misfeature (having dealt with the inevitable null reference/null value tristate hell left by some developers).
[ Parent
| on HN ]
Re:.NET Framework Version Comparision
by bunderbunder on Tuesday May 01, 2012 @11:44AM
(#3914880)
.NET won't allow you to create a Nullable<T> where T is itself a nullable type. (And Nullable<T> is not itself nullable.) I'm not sure about all languages, but in C# code like that won't even compile.
I agree, allowing a nullable wrapper around a (already inherently nullable) reference type would be a horrible misfeature. What language was that?
I just wish that rather than adding nullable primitives they added non-nullable objects. The type system used by googles javascript compiler has support for those and working with it is fantastic.
That would be fantastic - great idea!
No More:
Check.IsNotNull(objRef, "stop being a muppet");
Re:.NET Framework Version Comparision
by TazeTSchnitzel on Tuesday May 01, 2012 @07:18AM
(#3913787)
I thought .NET types were optionally nullable? I don't think they are by default.
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.
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.)