Check out and contribute to CodePedia, the wiki for developers.
*/
*/

$jonathan.ramble(topic => 'work' & 'play');

Theme Graphic
Theme Graphic

$jonathan.ramble(topic => 'work' & 'play');

My random-ish ramblings about my work at Programmer's Heaven and on the Parrot project, my crazy conference schedule and whatever else I feel like posting.

Subscribe

Author

I wrote my first computer program when I was 8 years old, and I haven't bothered to stop since! I graduated from the University Of Cambridge, England, in June 2006 having read Computer Science at Emmanuel College. Currently I'm doing consultancy work, a lot of it for this very site. I'm into a whole range of music, including metal, trance, old skool, and industrial. I'm a Christian and have previously been involved in youth and children's work with what was then my local church.

Archive

Tags


Delete Blog
Posted on Monday, February 04, 2008 at 8:25 AM

A wish for C# 4.0

OK, OK, so C# 3.0 is only just out of the door. As anyone who has been reading my stuff for a while will have realized, I like what they've done with the language. Here at PH, we have now fully migrated all our solutions to Visual Studio 2008, and can now use C# 3.0 language and .Net 3.5 framework features everywhere they're useful. This makes me happy (though some annoying issues migrating to Web Deployment Projects 2008 decidedly aren't making me happy).

I haven't thought long and hard about what I'd really like in C# 4.0. I think I need C# 3.0 to settle in a bit more. I've used it quite a bit, but it takes a while to fully realize the power of all that is there, and I certainly don't want to start suggesting additions to the language when there is already a perfectly good solution to that problem...
Comments: 1 Tags: C#, Language Design

Posted on Monday, December 10, 2007 at 6:01 AM

Inside PH: C# 3.0 and Linq

This morning I started working on a new library for a new feature we'll be rolling out in the not too distant future. It is the first production code that we're developing at PH using Visual Studio 2008, which brings us C# 3.0 and Linq.

Just one morning into it, it already feels like a vast improvement. It took all of ten minutes to get the DLinq classes generated in Visual Studio; it would have taken under five if it hadn't been my first time doing it and working it out as I went. Then they were ready to use, which was also trivial. No more writing SQL or stored procedures or calling methods on a data reader to get the data out: just instantiate the DataContext (which represents the database), write the query, and it's done...

Posted on Wednesday, November 28, 2007 at 6:25 AM

When C# bites

So I wanted to do:
private TTo Identity<TFrom,TTo>(TFrom I)
{
    return (TTo)I;
}
Well, actually I didn't. I wanted C# to be smart enough to realize that if S is a subtype of T then List<S> can safely be assumed to be a subtype of List<T>. But anyway, that's not the case, and you have to call ConvertAll on the List to get it to be a List<T> rather than a List<S>. Joy. Anyway, turns out the above fails to compile. Thankfully, this works:
private TTo Identity<TFrom,TTo>(TFrom I)
{
    return (TTo)(object)I;
}
But, argh.
Comments: 0 Tags: C#, types


corner
© 1996-2008 CommunityHeaven LLC. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.
Resource Listings