Friday, April 9, 2004

Good Article Series

I generally don't regret my lack of a formal CS degree. My EE background generally seems to have adequately prepared me to write software, as most of what you need to know, you don't learn in CS classes. Still, I do occasionally think about how it would be interesting to go back and take some classes, to learn some of the more formal stuff, like algorithms and data structures. Usually that's when I just go pick up a book on the topic and read it, to much the same effect.


Sometimes you don't have to buy a book, though. Today I was reading this series (particularly, the latest entry), and I really liked it. Choosing an appropriate data structure is an extremely common task in programming, and it's not always simple. For example, in just the last six months, I've had to deal particularly with how to represent directed graphs efficiently, and having read this beforehand would have been helpful.

Wednesday, April 7, 2004

New Lows in Home Improvement

One of the things I do when I'm not programming is work on the house. For the last year and a half, that has included gutting the basement, in preparation for rebuilding it newer...better...stronger.


As part of this process, I've busted a hole - about a meter square - in the concrete of the floor, to allow me to rip out and rearrange some of the lame-brained plumbing that's in place now. It's taken me weeks to make that hole (I don't exactly spend all my time on it), but I periodically show off my “progress” to friends when they come by.


Well, apparently one of them got the idea that I'm quite a bit more ambitious than my achievements to date would indicate. He sent me this.

Monday, April 5, 2004

Holy Crapoli

First Microsoft and Sun kiss and make up. Now this. They chose the IBM license, which - while not quite as easy to understand as my favorite, the MIT license - is pretty straightforward. Can't say I understand all the language about patents in it, but other than that it looks pretty simple.

Wednesday, March 31, 2004

Where Has Craig Been?

Most of these places, DevelopMentor sent me:


 


create your own personalized map of the USA or write about it on the open travel guide

Big Bummer

Ian Griffiths asks a great question in the comments on my post about System.Xml 2.0. Here it is:


That's excellent! But I have one question: why can't I do this?:

Book book = reader.ReadAsObject < Book > ();

What's with all this casting, in a world with generics? (Of course what you really want is for the template parameter to be inferred, but sadly you cannot infer template arguments from function return types.)


A quick experiment verified my assumption: generics are not CLS Compliant, as evidenced by this code:


using System;
[assembly:CLSCompliant(true)]


namespace GenericsCLSCompliant
{
  public class App
 
{
    static void Main(string[] args)
    {
      new Class1<App>().DoSomething(new App());
    }
  }


  public class Class1<T> where T : new()
  {
    public void DoSomething(T t)
    {
    }
  }
}


and the ensuing compiler error:


error CS3024: 'GenericsCLSCompliant.Class1<T>': type parameters are not CLS-compliant


What this means is that the important bits of the CLR libraries cannot leverage generics. This is a crying shame.

Tuesday, March 30, 2004

System.Xml 2.0 = Coolness

I was just reading this (via Aaron), and saw this piece of code:






if (reader.ReadToDescendant("book"))
{
   do
   {
      Book book = (Book)(reader.ReadAsObject(typeof(Book)));
      ProcessBook (book) // Do some processing on the book object
   } while (reader.ReadToNextSibling("book"));
}






OK, the highlighted bit is just so cool I can barely wait to start using it.


In case it's not obvious from the code, they've married XmlSerializer and XmlReader so you can stream through a document, yanking out objects as you go. They've also added the even cooler ability to write objects into an XmlWriter stream. To resurrect a saying from my youth: mint!

Sunday, March 28, 2004

DC Area Nerd Gathering

Tony Nassar proposes that we do a little get-together for those of us living in the DC area on Wednesday night, March 31st, starting at 6:30 at On The Border in the Tyson's Corner area. I think it's a fine idea! After all, we can't let the Denver and Portland guys have all the fun. Leave comments here if you plan to attend.