|
Sponsored Links
Resources
.NET Research Library
Get .NET related white papers, case studies and webcasts
|
News
News
News
|
Messages: 9
Messages: 9
Messages: 9
Printer friendly
Printer friendly
Printer friendly
Post reply
Post reply
Post reply
XML
XML
XML
|
 |
Microsoft Adds New Support for Nullable Types in .NET 2.0
Microsoft has added a last minute change to the implementation of Nullable types in .NET 2.0. This change allows for simpler null checks when using boxed references and generics. This new feature also provides the ability to coerce a nullable type to an interface implemented by the enclosed type.
The outcome is that the Nullable type is now a new basic runtime intrinsic. It is still declared as a generic value-type, yet the runtime treats it special. One of the foremost changes is that boxing now honors the null state. A Nullabe int now boxes to become not a boxed Nullable int but a boxed int (or a null reference as the null state may indicate.) Likewise, it is now possible to unbox any kind of boxed value-type into its Nullable type equivalent. Read more at Somasegar's Weblog
|
|
Message #182205
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
big fat mistake
I can't help but feel this feature is ripe for abuse and unmaintainable code. When some other programmer has to fix or patch the code, how long is it going to take to figure out what it means. I really wish Microsoft would push for better coding and development practices and less on questionable features. Having spent lots of time fixing really aweful code, I can see the rampant abuse now.
I'm sure plenty of people will disagree.
peter
|
|
Message #182224
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Is there a difference?
I've looked at the syntax in the blog post but I am failing to see any change at all in the syntax, either that or I need to go back and re-read it. Was the change just in the hidden boxing/unboxing stuff?
|
|
Message #182259
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
It's only in the Runtime...
<Quote> Once an instance of the type was boxed (by casting to the base ‘Object’ type), it became a boxed value type, and no matter what its original ‘null’ state claimed, the boxed value-type was never null. </Quote>
They tweaked the runtime behaviour of the generic Nullable struct, so that when the HasValue field is false and you assign it to a variable ot type object, this variable will be null, which is good, instead of being a boxed instance of that nullable type which is null...
Therefore I think this change is very nice and intuitive. Big up for the guys fixing this...
|
|
Message #182301
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
It's only in the Runtime...
I agree, big up, didn't know the issue existed however. Anyway, it works now how it should ...
|
|
Message #182328
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
It's only in the Runtime...
<Quote>Once an instance of the type was boxed (by casting to the base ‘Object’ type), it became a boxed value type, and no matter what its original ‘null’ state claimed, the boxed value-type was never null.</Quote>They tweaked the runtime behaviour of the generic Nullable struct, so that when the HasValue field is false and you assign it to a variable ot type object, this variable will be null, which is good, instead of being a boxed instance of that nullable type which is null...Therefore I think this change is very nice and intuitive.Big up for the guys fixing this... ok.. that makes much more sense. I retract my statement about it being a big mistake. though the blog and article both did a horrible job explaining it. not that I haven't horrible articles myself, but it would be better to have a clearer explanation.
peter
|
|
Message #182426
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Microsoft Adds New Support for Nullable Types in .NET 2.0
Why is the fuss with this very basic feature? Man, I can hardly believe the happiness and ectasis people is now feeling about being able to have a "Nullable Object"
As for myself... I'll stick to using the NullableObjects framework from SourceForge. It has solved my problems for more than 1.5 years by now.
Good luck!
|
|
 |
| |
|
New content on TheServerSide.NETNew content on TheServerSide.NETNew content on TheServerSide.NET |
 |
 |
Language "mashups" will become more prominent, and developers will become polyglots, one programmer suggests.
SearchWinDevelopment.com offers an introduction to the language, performance, testing and data management improvements in VS 2008.
VBCode.com code snippets cover all aspects of application development, from data binding to security to the user interface.
Get up to date on XAML best practices with a variety of articles, tutorials and webcasts. [SearchWinDevelopment.com]
One team's experience with the VSTS DB edition suggests that it can improve workflow for dev teams. It also enhanced Agile efforts.
(June 24, Article)
Microsoft has begun to include DSL tools in the VSTS kit. A new book by Steve Cook and other VSTS team members helps set the stage.
(June 24, Article)
Cartoon: Be it ever so humble there is no place like your home after you get a Microsoft Home Server .
(June 18, Cartoon)
Microsoft's Thom Robbins says new technology to highlight in NET 3.5 includes AJAX, LINQ for both C# and VB, as well as tooling enhancements intended to ease the task of building WPF, WF and WCF apps.
(June 29, Podcast)
Venkat Subramaniam discusses AJAX bottlenecks, the tenets of Agile development and more. He spoke at the Ajax Experience.
(June 25, Tech Talk)
In the second of a two-part series, Michele Leroux Bustamente discusses design decisions related to the claims-based security model. Read the story and walk through the process for creating a set of claims-based utilities to encapsulate claims authorization at the service tier.
(May 24, Article)
Understanding why the Entity Framework exists and learning where it can fit into your projects can get you prepared for the eventual release early next year.
(May 10, Article)
Resource: This learning guide gives you quick access to useful links on Windows Communication Foundation security information.
(April 24, Article)
TSS.NET's Jack Vaughan spoke recently spoke with Microsoft's Brad Abrams to find out what he is seeing in the field and what the chefs in Redmond are cooking. Along the way he discusses patterns of AJAX frameworks.
(April 11, Article)
In a two-part series, Michele Leroux Bustamente explains how claims-based security is supported by WCF, and how you can implement a claims-based security model for your services.
(March 29, Article)
Windows Workflow Foundation is a new technology that many developers will need to get their heads around. In a brief excerpt adapted from Programming Windows Workflow Foundation: Practical WF Techniques and Examples using XAML and C#, K.Scott Allen considers aspects of workflow definition.
(March 22, Chapter Excerpt)
|
|