CSharpFeeds - All your C# feeds in one place.

Wednesday, May 05, 2010

You don’t understand everything until you understand Nothing

by Patrik Hägne via Legend and truth on 5/5/2010 9:28:00 PM

Here’s a piece of code that might or might not do what you expect. (It depends on what you expect it to do.)Dim someAge = "999" Dim parsedAge As Integer? = If(someAge = "999", Nothing, Integer.Parse(someAge)) Challenge What will the parsedAge variable contain? Answer It will be a nullable integer with no value, right? Ehh, no wrong! -So, what will it be? Well, it will be a nullable integer – that’s the easy part – but it will have a value, zero (0)! Is this what you expected? It’s not what I ...

[ read more ]

Custom Configuration Section Handlers

by ssmith via Blog on 5/5/2010 4:38:00 PM

Most .NET developers who need to store something in configuration tend to use appSettings for this purpose, in my experience.  More recently, the framework itself has helped things by adding the <connectionStrings /> section so at least these are in their own section and not adding to the appSettings clutter that pollutes most apps.  I recommend avoiding appSettings for several reasons.  In addition to those listed there, I would add that strong typing and validation are add ...

[ read more ]

Subscribe

New Feed

Product Spotlight

Recently Updated Sources

Legal Note

The content of the postings is owned by the respective author. CSharpFeeds is not responsible for the contents of the postings. This site is automatically generated and cannot be reviewed for abusive content. If you find abusive content on CSharpFeeds, please contact us. Designated trademarks and brands are the property of their respective owners. All rights reserved.

Advertise with us