Archive for the 'Programming' Category

As requested by Scott, here’s the code to QuickTimer.
public struct QuickTimer : IDisposable
{
private readonly DateTime start;
private readonly string label;

public QuickTimer(string label)
{
this.start = DateTime.UtcNow;
this.label [...]


Scott linked to my previous post on the Schwartzian Transform. Not long after, Randal L. Schwartz himself (!!) drops by with a comment:
Wow. Interesting to see how different it looks in C#. Of course, I think the original in Perl still looks the most elegant.

As if response, Elton Wells comes up with an implementation [...]


Ben Hall has posted a good series on developing plugins for Windows Live Writer. Lots of practical tips here, including how to use Visual Studio to create an MSI-based installer for your plugin (which is a prerequisite for getting onto the Gallery).


I’ve been dabbling with the Wide Finder problem and have found a solution in C# 3.0 that is startlingly elegant.


Coincidentally, I have stumbled into a few interesting links about parallel programming over the past few days.
Task Parallel Library – Really cool, practical library for doing multithreaded programming in .NET. If anything it makes it a little too easy–it’s not a substitute for knowing the ins and outs of concurrent shared-memory programming, and you can’t [...]


(Update 8/25: Changed the example scenario slightly.)
Inspired by Beautiful Code, which I just started reading yesterday, I’ve decided to post some beautiful code of my own. Specifically, I’d like to show off some of the fancy features of C# 3.0, and explain why they’re good for much more than just LINQ.
What’s a Schwartzian Transform? It’s [...]


Sure, there have been Notepad replacements for years–TextPad, EditPlus, Notepad2, etc. I even tried emacs for a while. Somehow, none of those ever “felt” right to me. Sorry, I wish I could put my finger on it.
TextMate on OS X came close, but try as I might I could never get used to Mac-style keyboard [...]


IronRuby!

24Jul07

Somewhere deep in the Borg machinery, a small team led by John Lam is working on a fully open source implementation of Ruby for the CLR, and is even going to accept outside contributions.
Yesterday they announced the first source code release of IronRuby. It’s pretty rough so far, but showing a ton of promise. As [...]


Sim says:
I like Ruby but I don’t see it becoming a mainstream language soon. The biggest strength of Ruby–the OO nature of the language and some of its cooler constructs–are its greatest weakness. Consider continuations, for example. How many people in the world would know how to implement something with continuations without screwing up?
By definition, [...]