Overloading == to return a non-boolean

Were you aware that you could overload == to return types other than boolean? I certainly wasn’t until I started reading through the lifted operators part of the C# 2 specification. It’s quite bizarre – here it is in action: using System; class Test { public static string operator== (Test t1, Test t2) { return “Fish?”; } public static string operator!= (Test t1, Test t2) { return “Not a fish?”; } static void Main() { Test a = new Test(); Test b = new Test(); Console.WriteLine (a==b); } } That ends up printing “Fish?” to the console. Strange but true. … Continue reading Overloading == to return a non-boolean

Who do the "stars" look up to?

I follow a reasonable number of blogs. Not a vast number, but most of the ones I read (about computing, anyway) are written by people who are way out of my league. I mean, I can just about peer into the league of people like Simon Tatham who I’m proud to have as a friend even while I generally gape at his grasp of algorithms (verging on the obsessive at times, I have to say). Such people I regard as in a league above my own, and that’s fine – but then there are people like Don Box and Joe Duffy. If … Continue reading Who do the "stars" look up to?

Why hasn’t Microsoft bought JetBrains yet?

For those of you who aren’t aware, JetBrains is the company behind IntelliJ IDEA, the Java IDE which I’ve heard amazing things about (I’ve tried it a couple of times but never got into it – I think I need an expert sitting beside me to point out the cool stuff as I go) and ReSharper, the incredibly useful (although somewhat resource hungry) add-in to Visual Studio that turns it into a respectable IDE. What would happen if Microsoft bought JetBrains? I’m sure that killing off the reportedly best Java IDE would do .NET no harm (even if it would be … Continue reading Why hasn’t Microsoft bought JetBrains yet?

Implementing Ruby on .NET, and the importance of specifications

This morning, when following links to Jamie Cansdale’s ongoing tiff with Microsoft (best of luck, Jamie) I came across Martin Fowler’s concerns about Ruby on .NET. Most of the responses I’ve seen have – entirely reasonably – been about Microsoft’s relationship with open source and with the community as a whole. All of that is fine, but two points particularly caught my attention in Martin’s post: Soon-to-be-ThoughtWorker Ola Bini, a JRuby committer, reckons that it’s almost impossible to figure out how to implement a Ruby runtime without looking at source code of the MRI – but Microsoft imposes drastic limitations on … Continue reading Implementing Ruby on .NET, and the importance of specifications