Friday, October 19, 2007
Nullables always felt not quite done.

Here is a technique to add an extra minute to the microwave timer and get a more fully compatible conversion function:

http://blog.pumacode.org/2006/05/18/using-convert-changetype-on-nullable-types/

Nullable types are awesome for dealing with databases.  Its a fact of life that most databases are going to use null and you need to deal with it in your code.  However what does null map to for a value type? 

The answer is unknown.  If C# were truly object oriented then wouldn't value types be reference types instead.  I'm guessing there are some big performance implications to this.  So we have nullable types.  A solution that is almost ready for prime time. 

Side Note:  If you truly wanted a consitent web front end for a database then null would map all the way through to things like dropdownlists where they would map to the default "please choose" option.  This would be an awesome rails like feature.  I'll have to do that when I get around to building my own web framework.

That's not likely to happen anytime soon.  I actually built server controls that did the above.  However, the overhead of maintaing server controls and making them behave just like regular built in server controls is just too much of a burden at this point.  I'll have to revisit this at some point.

Friday, October 19, 2007 10:28:47 PM (Central Standard Time, UTC-06:00)  #    Comments [0]
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):