Category Archives: Uncategorized

ICloneable? Not quite…

I don’t usually post personal news on my blog, but this is fairly major. Some of you may know that my wife, Holly, is pregnant. What you won’t know – and what we didn’t know until today – was that we’re having twins. Eek! A lovely surprise, if somewhat scary. For those of you who like piccies, the scans are on my web site…

Now if you’ll excuse me, I think I’ll go and lie down. And to think I was going to write up C# 2.0 features tonight…

Nice doc comment idea

I’ve just been reading the
transcript of a whiteboard session with Anders Hejlsberg
and one of the questions
is really, really good:

Question: My problem is I’ve got these XML doc comments
that are duplicated. I just strip off one. I guess it would be a neat
language feature to be able to somehow indicate this is my primary- my
big method, right? With all the parameters. Then the other ones are
just going to borrow that XML doc comment.

Hejlsberg: Yes, okay. Now that I think is- that’s not a bad idea.
That yes, they should be able to share the documentation. I can sympathize
with that.

That’s not just “not a bad idea”. That’s a fantastic idea. When I was
writing the BitConverter and BinaryReader etc equivalents
in my miscellaneous utility library
the doc comments for the overloads took significantly longer to write than the actual code.
(Most of the code was just each overload calling a “master” routine.) Now, sometimes
that comment won’t be exactly the same for each overload; sometimes there’ll effectively
be placeholders: “Converts the specified ${type} value into ${n} bytes” or whatever. I don’t
know exactly how this could be done elegantly (and I’m not actually suggesting the ${token} syntax!), but it’s something that should be strongly
considered for a later version of C#. It could make life a lot simpler in some cases.

What kind of deadlock prevention do you want?

Okay, so I’m having another look at the alternative threading ideas
which are part of my threading article. (They’re not that big an
alternative really – not compared with CSP etc – they’d just make
things more pleasant.) I want to add deadlock prevention to my locks,
making it impossible to lock things incorrectly (so long as you’re
locking the simple way – if you lock the associated monitor
independently, that’s your own lookout). Obviously this requires you to
set up what’s correct and what’s incorrect to start with. My question
to you all is: how do you want to be able to set up those
rules? What kind of rules do you need? Do they need to be extensible
somehow? Some desirable things may be impossible, but I’d like to know
what the ideal would look like before working out the realistic. I have
a couple of pretty simple ideas, but I won’t taint your own views by
mentioning them yet…

RSS for my articles

A friend suggested on Sunday that I create an RSS feed for my articles,
so that interested parties would know when I’ve created a new one – so
I’ve done it.
It’s hand-crafted, so there may be a few wrinkles to iron out, but
hopefully it will prove useful. It would be nice if there was a way of
specifying the last time that an item had been updated (rather than the
original publishing date). I can’t see anything like that in the spec but maybe I’ve missed something. The feed works in Thunderbird at least – let me know if you have problems with it.