5 ms·
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 developer
by gouranga 15y ago
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).
- TazeTSchnitzel 15y agoI thought .NET types were optionally nullable? I don't think they are by default.
- gouranga 15y agoThey are optionally nullable. Unfortunately, people seem to think that making use of them everywhere is cool :(
- NetMonkey 15y agoBasic 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.
- DrJokepu 15y agoI 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.)
- tomjen3 15y agoI 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.
- gouranga 15y agoThat would be fantastic - great idea! No More: Check.IsNotNull(objRef, "stop being a muppet");
- bunderbunder 15y ago.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?