IDE colors

April 24th, 2008

I recently switched to a color theme with a dark background in Visual Studio 2005. The choice was almost purely logical: there’s more room for color variations. A light background will have dark text and a dark background will have light text, and the differences between light colors is more noticeable than the difference between dark colors (eg. compare #5f0000 and #00005f to #ff0000 and #0000ff). Therefore, the different elements of the syntax will have more variety and be easier to understand.

That’s my theory at least. We’ll see how it pays off.

I haven’t settled on a particular theme yet. Scott Hanselman has given some suggestions. Jeff Atwood has written about it, of course. So far I’m using Dark Visual Studio from Brad Wilson. I prefer its blues over some other themes’ browns.

Initially, I had a hard time seeing and understanding my code. I was looking for green comments, but they were purple. But I realized that the problem wasn’t the colors, it was the code itself. Even though I had written it the day before, and was looking at it just minutes ago, it become gibberish with a new theme.

The problem is that, when you’re writing code, you get used to seeing the shapes and structures of the text, more than the code itself. That method with a couple long green lines at the top and a too-deep if-nest at the bottom? Yeah I know what that does. But when the green code is purple and the blue statements are orange, it’s brand new.

I immediately refactored a large portion of the application.

It’s good to be familiar with your IDE, including the syntax highlighter, but I think it’s also good to step out of your element every now-and-then. If you’re working with the same code and the same colors for weeks, you can lose sight of the deficiencies. Change helps bring them back.

There’s one thing left though. This was just for VS2005. I also use VS2003 at work, and I sometimes use VS2008. Then there’s Notepad++, for anything non-.Net, which has dozens of themes itself. I really with there were a standard settings format that could be used by all major editors. Better yet would be if they all use the exact same file, so a single file in your user directory controls the highlighting in all your editors.

Another thin software development analogy

April 22nd, 2008

Software development is like making a table. It can be as fun, frusterating, time-consuming, rewarding, and difficult as you want.

Someone tells you the dimensions, the shape, the color they want, and acts like that’s enough to get a definitive estimate. A square, 4′x4′ table can be made in under an hour. Just nail a few boards together. Or it can take days (maybe weekx, I don’t know, I’ve never made a table), if you want to make it sturdy and robust, with intricate carvings, maybe a hidden drawer, and whatever other frills you can think of.

Of course, if you go to a table maker, you probably have a better idea what you want. I don’t think that’s the case with software development. I was asked to give some estimates today, to add some functionality to an existing app, and I’m just hoping I can get them right within an order of magnitude. Getting the functionality working, in the sense that the app can do what they want, if they ask it just right, any never want to change anything, would take only a few dozen hours. Getting it working right, so it won’t crash, and it errors gracefully, and it can be changed without a complete rewrite, and it has tests to verify that it works, might take a few hundred hours.

What type of table does your client, customer, or boss want? I think it’s usually safe to assume they don’t want the one-hour table. And the fancy table might be too much - they’re more concerned with the functionality. But that still leaves a lot of room to work with. If you try asking what they’re looking for, they’ll say they want a fancy table for a one-hour table price.

The trick is to give the estimate they’re looking for. When someone says, “give me an estimate”, what they mean is, “I’m thinking of a number”.

Raycaster updated

April 11th, 2008

I’ve updated my JavaScript raycaster. It doesn’t look much better than before, but it works better. I’ve also included a preview screenshot for the next version.