Today, I was super-dad AND got a lot of coding done, and I managed to get my useful links controls done for my site here. It was actually a complex process to get things like the webthumbs integrated, update the activity aggregator, create an admin page. The end result needs some cleanup, but I think for a first run, it came out nice. Tomorrow I will blog on the details and some code on how I did everything in case someone decides they want something similar.
Tonight, I am tired. But as I was coding, I came across some code for accessing my webthumbs, and something struck me. In .Net 3.5, there's a new keyword "var" which allows for anonymous casting (sort of). When it compiles, the underlying code is cast to the correct type, and in using the var typed variable, it acts like the cast-type. It would definitely speed up development if you used it a lot. For those old-school VB fans, it really reminds me of the variant data type (which it is not). Read more about it here if you want some details.
However, as with all things, there is a cost. For me, it's readability. In English anyways, we read left to right. When I see a "var" vast variable, I have to keep reading to understand the type, then see how it is used. Not too difficult (unless it is coming out of a function or LINQ query), but it does take a little more time to figure it out. For example..
var doc = new XDocument(
new XElement(
That being said, you can get around using it by declaring the variable to the expected type when you code it. I have some samples I will post later when I was using LINQ I forced myself to do this so I would fully understand what was happening in my LINQ. Here's someone else who is taking a similar take on it.
Anyone have any thoughts on that?