Book Corner: Coders at Work

I found an interesting book from my local library: Coders at Work: Reflections on the Craft of Programming is a book by Peter Seigel published in 2009. The book consist of 15 transcript style interviews where influential and merited programmers answer various kind of programming-related questions. I must admit I did not know even half of the interviewees in this book but I knew most of the technologies and software that they are famous for. Fortunately there is a short introduction of every person at the start of each chapter.

The interviewed programmers are quite heterogeneous group ranging from self-taught high school drop out Jamie Zawinski (early Netscape developer) to UNIX creator Ken Thompson and Donald Knuth (The Art of Computer Programming, TeX).

The first questions introduce the persons better (“How you started programming?”, “What was the first memorable program you wrote?”, “What are the tools you use?” etc.). Then the questions start to be more technical (“What’s the worst bug you’ve tracked down?” “How do you do debugging?” etc.) and often deal with the specific domain where the interviewee is an expert. The author is a programmer and it clearly shows in the questions. Even though many questions are the same from interview to interview Seigel does not follow a rigid pattern. Instead the questions flow naturally and at times the book feels more like a discussion from programmer to programmer which the reader is allowed to watch.

As one might expect there are as many approaches to programming as there are interviewed persons. In the interviews Seigel even asks if the person sees himself/herself as a scientist, an engineer, an artist, or a craftsman. It is interesting to read how different programmers answer to questions like “How important is mathematics?”, “How do you recognise a good programmer?” and “How do you familiarize yourself to code written by someone else?”.

The only disappointing thing is that most of the interviewed persons started programming several decades ago. The youngest interviewee is Brad Fitzpatrick, born in 1980. So some chapters may feel burdensome if you are not into nostalgia. I would not mind a second volume of the book with interviews concentrating on younger generation of programmers (people born in 70s and 80s).

To someone like me who is interested in programming as a form of “art” or “craft” this book is enlightening and must-have read. I do not recommend this for non-programmers or people who do not see any craftsmanship in software engineering.

Playing Red Alert 1 (Windows version) in 64-bit Windows

Back in 1996 our family bought a new shiny Pentium 133. That Christmas I invested exactly 300 Finnish marks (about 50 euros) on Red Alert. Originally the game was priced 319 mk but my dad is quite a bargainer. :) The turn of the year 96/97 I spent either saving the Europe or invading it. The game was freakin’ hard! I think that I finished the Soviet campaign on normal but I never played through the last allied mission. Or something like that. Many years have passed since then.

Electronic Arts rendered this classic game to freeware in 2008. The game originally had versions for DOS and Windows. As you might expect, the DOS version can be run in modern systems quite easily via DOSBox. The instructions for installation of DOS version can be found for example in this video. For those of you who want to read instructions instead of watching the video, here goes:

  1. Mount Red Alert CD image on a virtual CD drive
  2. Open DOSBox
  3. Mount your virtual CD drive to DOSBox (assuming i: is your virtual CD drive):
    mount d i:\ -t cdrom
  4. Mount your game directory to DOSBox: mount c c:\games (or whatever directory you use with your games)
  5. Go to your DOSBox CD drive: d:
  6. Run setup.exe

Setup may hang after installation is complete (The screen says “Please standby…”). Just alt+tab out of the DOSBox and close the DOSBox window. The game has been installed so this does not do any harm to your computer or screw the installation.

After setup finishes, you can play Red Alert inside DOSBox by running RA.exe. But the thing is that DOS version of RA runs in a crappy 320×200 resolution while the Windows version doubles it to 640×400. So how you can install and play Windows version?

Installation phase is simple – you already did it. That’s because the Windows installation is exactly the same as the DOS installation. The only difference is that you run RA95.exe instead of RA.exe. But if you double-click the RA95.exe in Windows you’ll get an error message: The procedure entry point SMap_LS_IP_EBP_12_could not be located in the dynamic link library KERNEL32.dll.

The solution is to run the patch which upgrades Red Alert v.1.04 to v.1.08PE. It is included in both Red Alert CD images in the patch directory. Note that double-clicking the virtual CD drive icon opens a menu which does not help you – the correct procedure is to right-click the icon and select “Open”.) Copy the contents of the patch directory to the directory where you installed the game.

If you try to run the patch in the game directory you’ll get another error: The version of this file is not compatible with the version of Windows you’re running. Check your computer’s system information to see whether you need an x86 (32-bit) or x64 (64-bit) version of the program, and then contact the software publisher. Trying to run PATCH.exe in compatibility mode for Windows 95 results the same error.

This error can be circumvented by running PATCH.exe in DOSBox. The Patch program is made for DOS but it patches the both RA.exe and RA95.exe. Patching seems to take time so be patient.

After patch is installed the RA95.exe can be run in compatibility mode for Windows 95 or Windows 98/ME. If you do not use the compatibility mode the game tries to start but then it crashes instantly. I was a little paranoid and applied compatibility mode to all executables in the game directory but editing only the RA95.exe might do the trick as well.

Now the Windows version starts but the colors might seem quite odd and weird. It has been discussed here. I didn’t manage to get registry fix working so I tried the solution where Windows Explorer task is killed before RA is launched. And it seems to fix the colors.

Open text editor, add the following lines and save the file as “start.bat” in RA directory:

taskkill /f /im explorer.exe
set __COMPAT_LAYER=Win98
"RA95.EXE"
start /i /b Explorer.exe

Now you can run start.bat in your Red Alert directory and enjoy the classic game in its Windows glory!

By the way, I must have been abysmal gamer back in the day. Now RA seems to be so easy game that you can beat it blindfolded…