2001/11/30

“Programmers should only use lower level tools for those parts of the product where they are adding the most value. For example, if you’re writing a game where the 3D effects are your major selling point, you can’t use an off the shelf 3D engine, you have to roll your own. But if the major selling point of your game is the story, don’t waste time getting great 3D graphics — just use a library.”

For your weekend reading pleasure, Rick Chapman interviewed me.

2001/11/29

CityDesk Is Here!

CityDesk

A few last-minute details, then — CityDesk is shipping! People can buy it! It’s a great feeling after a lot of work.

Time to say thank you. First and foremost, thanks to the CityDesk team who made this release happen on time. Thanks to our beta testers, for bearing with us through thick and thin and five beta releases, for trying CityDesk and building your sites with it. Thanks to our families and friends for supporting us while we worked late. Thanks to you, Joel on Software readers, for bearing with me while I stopped writing about software in the abstract and spent some time doing it. It’s been an exciting period and I’m going to sleep for a few months.

Do you have a T3?

The starter edition of CityDesk is free. But you can’t download the free version yet because our office T1 can’t handle the load and it will take a while to get the software up on Tucows.

In the meantime, we’re looking for a volunteer with a lot of extra bandwidth who is willing to mirror the free version for a few weeks until we have a permanent server for it with lots of bandwidth. Please email me if you can do this.

The SETUP is 8 MB and we are expecting thousands of downloads in the first few days — so don’t volunteer unless you really have a ton of excess bandwidth that you’d be willing to donate 🙂 Thanks.

Cool, We Got Mentioned In Australia

Sydney’s IT News: “Most of all, Spolsky wants people to want his product. He writes: ‘My number one priority is to make an application that’s easy to use so that people like it, so that they tell their friends about it, so that everybody buys it and we have to hire full-time employees just to slit open the envelopes and take out the cheques.'” Actually, I think I said “checks!”

2001/11/27

The last few days before shipping a product should be extremely quiet, as the rate of incoming bugs approaches zero. That’s where we are now. I’ve been putting the final touches on a new version of Fog Creek’s website (you can see a sneak preview here) and taking the word “Beta” out of the code wherever it appears. We’re likely to go live this week — exactly according to the schedule we set for ourselves six months ago.

A Hard Drill Makes an Easy Battle

I can’t say enough nice things about VMWare. This program has been amazingly helpful during the last few weeks as we tried to get CityDesk to work on every known version of 32-bit Windows. I have set up dozens of virtual machines, everything from a simple DOS partition (helpful as a starting point for installing other OSs), a bunch of combinations of NT 4.0, Chinese and Hebrew Win2K (even though our program is in English and doesn’t do anything fancy, we had various bugs that were revealed on these systems), assorted versions of Win 95/98/Me going all the way back to the August, 1995 release, even a small network of machines with a primary domain controller which we used for testing FogBUGZ setup.

VMWare

Getting code to work on the entire universe of Windows machines is a lot of work. That’s the real appeal of “write once, run anywhere” systems like Java. In theory, if you use the Java Virtual Machine, the burden is on the VM vendor to provide compatibility with all these platforms. In reality, as Java programmers learned, code is just too fragile for this to work very well. When I developed a game with Java I learned that Java’s inability to guarantee exactly when threads would run (a seemingly harmless concession to the fact that CPU scheduling is basically unpredictable) actually meant that on the Macintosh, some threads got starved, um, forever, basically, until the other threads tried to do i/o in fact, which is not what I had assumed and made my game not very challenging on Macs. (This was in 1996. Don’t email me with workarounds, fixes, or to say that this bug has been fixed.)

Yesterday’s Bug Du Jour is an example of the kind of thing that trips people up. Michael was allocating some memory using the ancient Windows API GlobalAlloc. Later, he was calling a function GlobalSize to determine the size of that memory. On our development systems (Windows 2000) GlobalSize returns the same value as the block you allocated. Allocate 13 bytes, and GlobalSize will return 13.

We got a bug report that “Copy and Paste don’t work” from a user with Windows 98. As you see from the screenshot above, I’ve got a Windows Me VM set up with VB6. Stepping through the code in the debugger I noticed the GlobalSize call, and remembered from the days of Win 95 that GlobalSize used to return the size of the actual allocated block, which was larger than you allocated and usually a multiple of 64. This led to the bug.

Now, the programmer at Microsoft who changed the behavior of GlobalSize probably thought he wasn’t breaking anything. The documentation for the function “GlobalSize” says clearly, “the size of a memory block may be larger than the size requested when the memory was allocated.” In fact the Microsoftee probably thought it was a minor and harmless improvement to GlobalSize to have it always return the size that you requested. Obviously any old code, that doesn’t trust the return value from GlobalSize, will continue to work. So why not improve the function?

Not every programmer studies every line of the documentation for every function they use, and if the code is working, they tend to move on to something else. And it’s not like everything is documented all that well — the type of minutiae that I’m talking about here rarely gets discussed in documentation. And this is where you get these issues. The rest of the world discovered this problem, long the bane of WINE programmers, when the second web browser shipped, and suddenly everybody was noticing how the bugs they had counted on to make their pages look kewl weren’t there any more. As we speak zillions of HTMLers are bemoaning the fact that IE6 now adheres to the standard for what <CENTER> does to the text inside a table, and so their pages that looked left-justified look like wedding invitations in IE6.

How did we get into this mess? Larry Wall famously said, “People understand instinctively that the best way for computer programs to communicate with each other is for each of the them to be strict in what they emit, and liberal in what they accept.” I think that the evolution of HTML has proven that this isn’t such a great idea. In fact, the stricter the API is about its input, the more likely the code is going to work in funny situations. The designers of Java got it right when they decided that nothing about the Java spec should leave any choice to the compiler developers (at least, not in the gratuitous way that C did, where the size of basic data types was not fixed). A better quote comes from Russian Field Marshal Suvorov: “A hard drill makes an easy battle.” You want your compiler and your development environment to be as strict as possible; you want it to literally generate random return values for GlobalSize so that you don’t get into the habit of counting on something that won’t be there everywhere; you want to use French international settings on Chinese Windows 2000 with an absurd color scheme, DVORAK keyboard, trackball, 640×480 VGA mode, and huge ugly fonts on your development system so that you remember to bake in the code that adjusts for all these things. Then your application will be buff and strong and it will laugh in the face of wimpy problems like people who use commas instead of dots as the decimal. Ha. I eat commas for breakfast, your code will say, with a Russian accent.

Anyway, this is what it takes to get software that works on hundreds of millions of computers. Those of you who develop apps that only have to run on one computer or in a controlled environment have it easy, but you’re getting flabby. One of these days you’ll need to get it to run on a second computer and you’ll need to pull an all nighter, installing a complete development environment on that computer and debugging for two hours, before you discover that you didn’t account for the possibility of spaces in the installation file path because the first computer didn’t have them. 

Hopefully in the future the concept of a Virtual Machine, whether it’s Java, .NET, or something else, will alleviate this pain, but we ain’t there yet. For now I’m happy that with ten minutes of debugging, I can make my app work for all the people who like pink on orange text and set up Windows accordingly. We spent probably 3 weeks of work, out of a 1 year development cycle, fixing configuration bugs. A small price to pay to increase the size of our potential customer base from just US Windows 2000 to the entire universe of NT 4, 95, 98, Me, and XP, worldwide. Cool.

2001/11/20

*Larry Wall famously said, “People understand instinctively that the best way for computer programs to communicate with each other is for each of the them to be strict in what they emit, and liberal in what they accept.” I think that the evolution of HTML has proven that this isn’t such a great idea. In fact, the stricter the API is about its input, the more likely the code is going to work in funny situations. The designers of Java got it right when they decided that nothing about the Java spec should leave any choice to the compiler developers (at least, not in the gratuitous way that C did, where the size of basic data types was not fixed). A better quote comes from Russian Field Marshal Suvorov: “A hard drill makes an easy battle.” You want your compiler and your development environment to be as strict as possible; you want it to literally generate random return values for GlobalSize so that you don’t get into the habit of counting on something that won’t be there everywhere; you want to use French international settings on Chinese Windows 2000 with an absurd color scheme, DVORAK keyboard, trackball, 640×480 VGA mode, and huge ugly fonts on your development system so that you remember to bake in the code that adjusts for all these things. Then your application will be buff and strong and it will laugh in the face of wimpy problems like people who use commas instead of dots as the decimal. Ha. I eat commas for breakfast, your code will say, with a Russian accent.

A Hard Drill Makes an Easy Battle

2001/11/16

I noticed that people were putting HTML tags in discussion group postings, and they didn’t know what to do about URLs. So I added some tiny text below the edit box where you type your posting… not that anybody reads tiny text, but we’ll see if it helps!

I’ve long believed that tiny changes in the user interface of any kind of community software result in dramatic changes in the character of the community that you create. I noticed this way back in college, when CompuServe forums generally had two-line postings and nobody ever quoted other people, but Usenet newsgroups had lengthy postings with 21-line ASCII art signatures and 50% quoting. Usenet resulted in the ultimate pathology: people quoting an entire three page article, and inserting their tedious nitpicks between every two lines.

My own discussion software does not have threading. “Threading” is technical jargon for a discussion feature where different people can branch in different directions by replying to replies. You end up with a tree of conversation. Most forum software has this feature and some people were rather angry that mine doesn’t.

I first noticed the value of one-train topics using the echo community software, which is, in all other respects, excruciatingly bad. Something interesting happens sociologically when you don’t have threading: the conversation is forced along one train of thought. People feel like they can respond to the original inquiry, or they can respond to the last post, but if they want to nitpick about the third post and there are already twenty more posts after that, it’s just too late. This seems to eliminate the most gratuitous trivial “yes, I agree” or “you nitwit, you misspelled that” kind of posting which makes it boring to read other forums.  The other thing which eliminates them is that there’s no automatic mechanism to quote other people. Sheer laziness will prevent most people from tagging on comments that aren’t an interesting extension to the current thread. If you really want to set off on a tangent, you have to write something like “I’d like to go back to what X said earlier…” which actually makes the whole topic read more coherently.

Another mechanism for eliminating trivial and uninteresting postings is the slashdot method of having moderators hide them. Theoretically, you can set your threshold high on slashdot so you only see the most interesting posts, but this gives the conversation a choppy feel when you’re reading it.

TechInterview

Michael’s TechInterview is back up and running, with its own discussion group. He’s moved it from Manila to CityDesk, which allowed us to completely decommission the Manila server.