Archives

Archives / 2004 / July
  • Didier Besset, C# Express, and NUnit

    One of my most neglected hobbies is numerical computation (amid this sea of database access, layers, patterns, and services, anyone remember that one?), an example: a couple of years ago I bought the interesting Object-Oriented Implementation of Numerical Methods: An Introduction with Java & Smalltalk by Didier Besset, by then I was programming in C# and immediately had the idea of translating his algorithms to C#. Well, two years later (that is a couple of weeks ago) I dragged myself to do it only that, for being at least a little bit innovative, I decided to use C# 2005 Express. I know, I know, there are translators from Java to C# but, remember, this is my hobby, so I decided to take the scenic route; the process has been relatively painless (I'm in Chapter 7 now, working a few nights per week) and I've been able to use some of the nice features of C# (like operator overloading for polynomial operations, and List<double> instead of ArrayList for variable size vectors). Anyway, some doubts appeared on the way and I decided to contact Dr. Besset, after a couple of searches in Google I found his address and sent him my questions, to my amazement he promptly answered, and so here I am regularly e-mailing with Didier :-) One of the things I needed was some test data to validate my C# translation. Didier first sent me some test code in Smalltalk and then some more unit tests in Java, now to use them I needed NUnit, so this morning I downloaded the latets (beta) version of NUnit and, as it refused to install without .NET 1.1, I downloaded the source code, opened it with VS 2005 and recompiled it, had an error due to a missing resource file but, as it was used only in one menu option, I blatantly commented the calls and tried again: voilá, in spite of a raft of warnings, NUnit now runs on my .NET 2.0 Beta 1 environment. So, finally I translated some of Didier tests and, to my exhilaration, my code actually *passed* them. Isn't programming fun?