How Many Programming Languages Have You Used?

I’ve been hearing all the buzz for the last several years over dynamic languages like Ruby and Python. I always like to try the latest and greatest from time to time and sometimes even move myself professionally in that direction. I guess because I started out working primarily with interpreted, weakly typed languages and I’m now horribly spoiled by intellisense, I’m having trouble even taking a look at either Ruby or Python (yes, I know they are *technically* not weakly typed, but the “dynamic” part equates in my feeble mind). I was perusing a list of programming languages trying find an interesting alternative to Ruby or Python to play with, and thought it would be interesting to list the ones that I’ve actually written programs in and what level of experience I have with them.

BASIC — Hobby (Like many others, lowly BASIC got me hooked on programming at an early age)
dBaseIII — Production
Clipper — Production, Commercial
TurboPascal — Academic
DOS Batch — Production
8086 Assembly — Production, Commercial
Modula-2 — Academic
PDP-11 Assembly — Academic
Lisp — Academic
Prolog — Academic
Smalltalk — Academic
Ada — Academic
Actor — Hobby (Am I forgetting the name or how it’s spelled? Can’t find a link.)
C — Academic, Production, Commercial
C++ — Academic, Production
Protel (Nortel proprietary — I actually worked on the DMS 250) — Production
Rexx — Production
Visual Basic — Production
T-SQL — Production
Java — Production
PL-SQL — Production
C# — Production
PHP — Production

One language I left out was the pet project of a professor of mine in college. It was Prolog-like language that he had us implement as our major assingment in compilers class. I actually won a copy of his book (aren’t you jealous :p) for having the best compiler in the class. Unfortunately, I threw the book out a few years ago and I can’t recall the name of the professor or the langauge for the life of me.

So which languages have you used and which ones are you interested in learning?

RAID 5 Sucks on Intel Matrix ICH8 (82801 SATA RAID) Integrated Controller

I started using RAID 1 as a matter of course after suffering some major downtime due to hard drive failures on my desktop and home machines a long time ago. First, I used the software RAID available in Windows NT (or was it WIN2K?). As I started building machines with integrated (fake raid, as some people call it) RAID controllers, I took advantage of them instead of using software RAID which was, in my experience, susceptible to frequent rebuilds due to lock-ups and power outages.

In the last machine I built, I decided to give RAID 5 a try, mainly because the 320Gb drives were so cheap at that time (but I didn’t want to buy 4 or larger ones I guess?). I develop on this machine, so write performance is very important. I’ve been running RAID 5 for the last 10 months or so. I’ve never been particularly happy with the performance of this machine. It always spent a lot time hammering the hard drives and I noticed that things would get sluggish, even though my CPU utilization never cracked 5 or 10 percent.

Things finally came to a head when the family and I went snowboarding for spring break. I really wanted an offsite backup of two of my machines in case someone broke into our house and stole the computers. One is my development machine (RAID 5) and the other is our household server for photos, music, and movies (RAID 1) which also doubles as the second gaming machine for my son’s friends, believe it or not.

I had forgotten that I used RAID 5 on my development machine. I ran up to Best Buy and picked up two hard drives that I was planning to exchange with the existing hard drives in the machines. The existing HDs I removed would be my instant offsite backups. On the machine running RAID 1, this worked beautifully. On the machine running RAID 5, it obviously didn’t work at all. Since this was the morning before we were leaving, I barely had time to copy important files from my development machine to my laptop, which was coming with us and would serve as an offsite backup of sorts.

When we got back from vacation, I wanted to salvage the money I spent on the extra drive for the machine using RAID 5. I disconnected one of the drives in the RAID 5 array as the first step in trying to migrate to some different configuration. When I reattached it, my machine was unusable for 22 hours! I mean so slow it was truly unusable! Turns out, RAID 5 suffers up to 80% performance degradation when rebuilding. You can see the gory details here. Not only that, but on the ICH8 controller, you can’t migrate from RAID 5 to any other configuration. I even tried turning on array write caching to boost performance. This helped a little but be prepared for that hideous rebuild every time you hit the reset button or suffer a power outage.

Now here’s where I really saw how badly RAID 5 sucks. I still had the 500GB hd I bought that I was going to use to mirror my dev machine to. So I swapped that in to my household server machine’s RAID 1 array which had only 2Gb free (my wife takes an insane number of photos). 20 minutes later, the array is already rebuilt. Not only that, but the machine is actually usable while the array is rebuilt. I then bought a second 500Gb drive, swapped that in, and, viola — I had just increased the capacity of my household file server in less than an hour with no pain whatsoever.

Meanwhile, my dev machine is still on RAID 5. I do some research and realize that RAID 5 suffers from really bad write performance. Combine that with the fact that it’s literally unusable (at least on ICH8) while a rebuild is underway and it’s only advantage is space effeciency, and you must conclude that RAID 5 on the ICH8 (82801 SATA RAID) is a terrible choice for a development machine.

Now, how in the world do you recover from your horrible choice of RAID 5 on ICH8 without doing a complete reinstall (which is incredibly painful)? Not easily! Since I had RAID 5, the array was larger than the the individual drives that made up the array so you can’t just take a drive out of the array and copy over to it. So now you need to shrink an NTFS partition, assuming your usage of the array, like mine, is still less than the size of component drives.

If you weren’t using RAID 5, shrinking your partition would be free and easy using Ubuntu 7.1. Unfortunately, even if you go to the trouble of trying dmraid, it doesn’t work with RAID 5. After hours of research, I finally ended up buying Acronis Disk Director which worked perfectly. I was able to shrink my partition down to 200GB and then copy it to another drive.

Since I now had 6 320GB drives, I converted my newly liberated 200GB Windows XP NTFS active partition to a RAID 10 array. Just in the time it took me to write this post, the rebuild is already 40% complete and the machine has been completely usable during that time.

In conclusion, RAID 5 on the IC8H SUCKS!!! Don’t use it under any circumstances. Disk space is so cheap there’s no reason to use RAID 5 instead of RAID 1 or RAID 10 on a workstation. Either buy one more drive (RAID 10) or buy two bigger drives (RAID 1).

Declaritive Nullability In Programming Language Constructors

I’ve often thought shallowly about but never had much chance to explore the idea of a new programming language or enhancements to existing programming languages for unit testing. Unit testing has come a long away over the past 5 years but I still feel like there’s a lot of room for improvement.

I’m a big fan of constructor dependency injection because it makes the depdencies of your class crystal clear. If you add a dependency, you have to review all of the code that instantiates instances of your class, which usually is a very good thing. I frequenty add a check in the constructor that throw a null argument exception if the actual parameter passed in is null. Resharper makes this easier, but I’d really like to see a way to do this declaritively, like field nullability in table declarations in SQL DDL. EG, in SQL you have:

CREATE TABLE Blah (counter int not null)

Wouldn’t it be nice to have something like this in a c# constructor?

public SomeClass(notnull IDataAccess access)

Instead of adding a check for null and throwing an exception yourself (or having resharper do it), the compiler would take care of this for you. Also, you wouldn’t need to test that the constructor throws an exception when a null actual parameter is passed in.

Actually, the more I think about this, the more I’d prefer that constructor arguments default to not being nullable and instead have a nullable key word.

Has anyone thought of any other things that you could do to tweak a language to make it more unit test friendly?