Sunday, March 26, 2006
Today I flew to Barwick Lafayette Airport (9A5). There was no particular reason to go there, except that I hadn't been there before.
A tip for anyone flying into the airport: the locals pronounce the town's name as la-FAY-it, not as la-fee-YET, which some might expect. Welcome to Georgia.
Over the past year or so, my group's applications have started using XML instead of the older, poorly documented, ad-hoc data formats we used in the past. In the client application, we are using XML for these purposes:
- Application configuration
- Network configuration
- Screen layout
- Communications with the server
We have these four uses of XML, so of course, we have four different XML parsers linked in to our application. One is Xerces, and the others are home-grown. The guy who used Xerces put his own "easy-to-use" wrapper layer around it, so you could say that we really have five XML APIs within our application.
As you can probably guess, the three home-grown parsers were written by three different people. At least two of them gave their header file the name "xml.h", so there was a lot of fun trying to get everything to compile when multiple parsers were integrated. We also had two "xml.lib" libraries to contend with.
At some point, we'd like to have just one XML parser. But that would take a week or so, and right now the schedule doesn't allow us to spend a person-week on something that doesn't help us make the deadline. So we'll fix it later. (Yeah, right.)
It's times like this that I really wish we were writing our app in Python, Ruby, C#, or some other language that has XML support built-in to the standard libraries (or which has a de-facto standard implementation). C++ was created before XML, so there is no standard way to handle XML. C++ programmers who need to support XML take a look at Xerces and other off-the-shelf libraries, but then most of them decide it would be easier to roll their own than to figure out the complex APIs the libraries provide.
What really bugs me is that none of these uses of XML are making things any better. They bloat the app (the Xerces DLL alone is bigger than the rest of our application), and they make it more difficult to build and to debug. But I guess it's what the cool kids are doing these days.
Thursday, March 23, 2006
For the first time, I have a two-monitor setup on my main desktop machine at work. This means I have two monitors side-by-side, and the computer treats them as one wide desktop. I can move the mouse from one to the other just by, well, moving the mouse from one to the other.
This works well. I typically have my software-development application running full-screen on one monitor, and then the other monitor has the miscellaneous e-mail, IM, web browser, and other little windows I need. It helps me maintain my focus on my work, as I don't look at the other monitor while I'm coding, and I don't need to hide or shuffle windows to get things out of the way.
I have two other computers on my desk, and I find myself unconsciously trying to move the mouse over to those other screens. It would be really nice if this would actually work: I could use just one keyboard and mouse instead of the three that I currently need. It would also be cool if I could pick up a file on one machine and then just drag-and-drop it over to another computer's monitor to transfer the file.
Extending this idea even further, it would be nice if all four monitors on my desktop were connected in one big clustered desktop. I could launch an application on my test machine, then drag its window over to my development machine so that it was displayed right next to the debugger window. Then I wouldn't have to keep flicking my head from side to side while doing remote debugging.
I don't know if there are already any implementations of this kind of functionality. If not, I may try to implement it myself some day (in my copious free time). It would probably be relatively easy with the X Window System, which is designed to operate over a network, but all my work machines are running Windows.
Wednesday, March 22, 2006
The Apologetic Coder
Today's The Daily WTF is destined to be a classic.
Tuesday, March 21, 2006
"Kris, there's something wrong with the scanner, and so the application doesn't run. You're working on the scanner right? We need you to fix it immediately!!!"
I get this complaint about once a day. There is nothing wrong with the scanner. What's really happening is that, when somebody tries to run the application, they get this message:
This application has failed to start because Scanner.dll was not found. Re-installing the application may fix this problem.
Then, the person getting the error asks who's responsible for the scanner, and then they come to me, asking how I could be so incompetent.
In reality, it has nothing to do with me or with "my" Scanner.dll. The problem is that their machine is not set up properly, or their debugger settings are screwed up. Their applications really can't find any of the DLLs they need, but Scanner.dll happens to be the first one to get loaded, so that's the one identified in the error message and I get the blame.
So I blow ten minutes a day helping people re-configure their systems so that the application works. About eight of those minutes are spent listening to the complainant repeatedly assert that they have everything set up properly, that it worked fine yesterday, and that I must have changed something that made things break. The first few times, I gave people the URL to a web page that described exactly how to set up the application, but now I don't bother, because I know nobody is going to read it.
I'm trying to figure out a way to randomize the DLL loading order, so that other people will occasionally get the blame, and get to play tech-support flunkie. I've also considered changing the DLL's name from "Scanner.dll" to "YourWorkingDirectoryIsntSetCorrectly_AskBillToFixIt.dll".
Sunday, March 19, 2006
World of Warcraft
If you're a geek younger than 40, you already know what World of Warcraft (WoW) is. For the rest of you, I'll give a brief overview: WoW is a networked computer game where millions of people interact with one another in virtual sword-and-sorcery fantasy worlds. Players control imaginary characters in a three-dimensional environment. They can kill monsters and one another, can embark on quests to retrieve magical items, can buy/sell/auction items, and can chat with one another. For just $15 a month, you can play as much as you like.
WoW boasts over 6 million active accounts. That's a lot of players, but it is still small in comparison to the overall population of the US and other countries where WoW is played. But somehow, almost everybody I know plays it. I have friends who play it. My flight instructor plays it. My boss and other team members play it. Our CTO talks about it in meetings. I guess I must be smack dab in the middle of the WoW demographic.
WoW and similar games have been called "the new golf." These are activities that lots of people can discuss and play together, building relationships between business associates.
After seeing the ridiculous amounts of time these people spend playing and talking about the game, I decided I did not want to play it. I tried EverQuest (a similar game) a couple of years ago, so I know what a waste of time it is. I'm a grownup (supposedly), and I've got better things to do with my time than play Dungeons & Dragons on a computer. Really, no way.
Well, last week I bought World of Warcraft. Or maybe it was two weeks ago. I'm not sure; I've lost track of time. I wonder whether I've been showing up for work on all the right days.
It's impressive. I'm not interested in it as a game as much as a work of craftsmanship. The landscapes are beautiful, the animated characters are entertaining, and the storylines have more depth than I expected. The more of the simulated world I see, the more amazed I am at all the work that went into it.
One nice thing is that it was released for both Mac OS X and Windows. The installation discs contain both versions, so I didn't have to buy a second copy for my Mac. Unfortunately, my iMac G5 is not a top-of-the-line machine, so I have to settle for low-resolution graphics and toned-down special effects on that machine. It's playable on my Mac, but my Windows box in the spare bedroom is all pimped-out for gaming, so I do most of my playing there.
After a few days of spending way too much time playing, moderation has set in. I'm now only playing an hour or two a night, and some nights I don't play at all. This frustrates my co-workers, who want me to get up to level 60 as quickly as possible so I can join their group and fight the really big monsters. But that doesn't interest me. I like running around the world, hunting monsters, and riding the goblins' zeppelins.
Back when I was a kid, when the Atari 2600 was the state-of-the-art in gaming consoles, and when the Infocom text adventures were the epitome of computer gaming, my friends and I would talk about how cool it would be if there was a virtual-reality role-playing game. That dream was one of the things that got me into computer programming. I thought EverQuest would be the fulfillment of that dream, but it wasn't quite there. World of Warcraft is. I wish I could have been part of that development team—this is something that would make me very proud.
If you're around levels 10-15, and want to do some questing together, give me a whisper. I've got characters named Bovo and Shamm in the Illidan realm, and Groan and Ugger in Rexxar. I'll need to stop playing at around 8:00 AM, so I can go to work.
This is really cool: http://tryruby.hobix.com/.
As I've risen up the ranks, more and more often I am called upon to participate in interviews. I hate this, because I am always ill-prepared. There is usually no warning—the boss pokes his head in my office and asks me if I have fifteen spare minutes, and if I do, he hands me a resumé, introduces me to the candidate, and then I'm supposed to figure out if the candidate is a good one.
I'll note that it is not just my current boss who does this to me. Of all the interviews I've participated in during the last fifteen years, there was only one that I knew about before it happened.
I've made two hiring decisions myself during my career. One of those decisions was a good one, the other was not. I'd like to get a better-than-50% good-hire rate.
I've always wanted to sit down and prepare a few good interview questions, so that I'll be more prepared in these situations. My boss has a couple of really good programming exercises he gives to each candidate. Here's what is good about them:
- They involve writing actual code, so the candidates have to demonstrate actual skill, and can't just BS their way through the interview.
- If the candidate writes correct code immediately, then the boss is absolutely sure that the candidate is someone he wants. This saves a lot of time, as we can go straight to the "What salary do you want?" and "When can you start?" part of the interview.
- If the candidate gets stuck, the boss will offer hints and encourage the candidate to ask questions and talk through their thinking. This provides good insight into a candidate's reasoning skills and ability to discuss technical matters.
- About 90% of candidates can't get the right answers, even with assistance. This saves a lot of time, as the interview usually stops at that point. The exercises aren't very difficult, so anyone who can't do them is unsuitable for a programming position in our team.
I like these exercises, but they do have a couple of weaknesses. First, they are specific to C++, so they can weed out people who would be good assets, but haven't had a lot of experience with that particular language. Second, they deal with low-level implementation issues, so they are good at determining whether the candidate understands how computers really work, but not very good at discovering how the candidate approaches higher-level architectural and design issues.
So, I now have a goal of creating some incisive exercises for evaluating a candidate's higher-level abilities. I want exercises where the candidate has to do real coding, and where there are ample opportunities to talk about how they think. Here are my initial ideas:
- Give the candidate a bug report, and make the candidate fix the problem. I think this would be a good test of the ability to read code and diagnose problems.
- Give the candidate a new-feature request, and make the candidate implement it. I think this would be a good test of the ability to figure out how an application works, and to see how much of a mess they are going to make when they touch our code.
- Give the candidate some really bad code, and ask them to refactor it.
- Give the candidate a small set of unit tests, and have them write code that makes them all pass.
A problem with these ideas is that each one may take a lot of time. Another concern is that the candidates may not be able to use their preferred editors and programming environments, but I think any good programmer should be able to get by if offered Visual C++, Emacs, and Vi.
I don't want these exercises to be difficult. I want good candidates to breeze through them. They should be just difficult enough to catch the people who don't belong in our industry.
Saturday, March 18, 2006
Shopping for Web Hosting
For the past few years, my kristopherjohnson.net and kristopherjohnson.com domains have been hosted by providers that have disappointed me. They've disappointed me, but not so much that I had the urge to do the work needed to move to another provider until now.
What's changed is that my old credit card expired, so they can no longer automatically charge me every month unless I renew the info. I've noticed that I haven't done anything with my web sites for a couple of years, so I won't lose much if I make a fresh start.
So, I'd appreciate it if regular readers of my blog could make some suggestions. No spam, please. No web hosting salespeople, please. I just want to hear from "regular people" who are happy with their providers. (I'll quickly delete any comments that break these rules, and post nasty comments about the perpetrators.)
Here's what I'm looking for:
- Support for Python, Ruby and Rails (and I'll just assume everybody supports Perl)
- CVS or Subversion
- 1 GB drive space
- UNIX (preferably BSD or Linux)
- Knowledgeable tech support
- Multiple domains (at least three)
- Less than $30/month
I'm not planning to run any high-volume or commercial sites; this is just for my own personal tinkering.
TextDrive looked like a good choice at first, but they prohibit "testing, development, tinkering, or sandboxing in any form." Without those activities, just what are computers good for, anyway?
[UPDATE: As of now, the main contenders are A2 Hosting, Bluehost, DreamHost, and RailsPlayground.]
[UPDATE #2: I've set up an account with A2 Hosting. You can never tell how good a provider is until you actually try them out. If A2 isn't to my liking, DreamHost will be my next choice.]
Friday, March 17, 2006
Spelling-Police Enforcement Action
A few weeks ago, I complained about poor spelling in our new codebase, and promised that eventually I'd fix it, despite other programmers' objections.
Today was the day. A few forces came together to give me the push:
- The lead programmer quit last week. I'm sorry to see him go, but it gives me the freedom to ignore his aesthetic choices.
- Another proud misspeller has been out sick all week.
- The code has been pretty stable for the past several days, so I could safely modify a couple dozen files without stepping on anyone's toes.
- We're about to start the next phase of the project, so I wanted this cleaned up before we got too busy with other things
- It was Friday afternoon, and I didn't feel like doing any real work.
I changed all the instances of okey to OK (eight places), all the instances of seperators to separators (24 places), and all the instances of quanity to quantity (284 places). When I was finished, I had the greatest sense of accomplishment I've had for years.
I wish I could say that after making all these changes, I re-ran our automated unit tests to verify that I didn't miss anything and that nothing broke. The problem is that we don't have automated unit tests. So I'll just have to cross my fingers, and if anything does go wrong, I'll just blame the ex-employee.
Sunday, March 12, 2006
It's 81 degrees today in Atlanta. It's still officially Winter, isn't it?
Saturday, March 11, 2006
Programming Languages and Snob Appeal
David Megginson argues that development and adoption of new programming languages is a self-perpetuating cycle driven by the desire of elite developers to distinguish themselves by not using what everybody else is using.
There is some truth to that, but it's not just snobbery that causes good programmers to migrate to new languages. When a bunch of smart people form a new community around a programming language, it's great fun. The appearance of a new programming environment presents a blank slate where the users can start over from scratch, and this appeals to creative minds. People create a lot of cool new stuff, people argue about the merits of the languages features and suggest improvements, and people work together very hard to figure out how the new language can express new ideas.
If the programming language becomes popular, then the "community" starts to deteriorate. Rather than being dominated by smart people saying smart things, the mailing lists and forums are dominated by dumb people asking dumb questions. They ask about syntax, rather than taking time to read the language reference manual. They complain about bugs, rather than submitting fixes. They complain because they can't get the interpreter to compile on OpenVMS. They ask why the new language can't be more like the old languages they already know. They write bad code, wonder why it doesn't work, and blame the language designers for their problems. When the smart people try to continue to make contributions to standard libraries or to improve the language, the new people complain because they don't like it when things change. For the smart people, it's not fun anymore.
This is what drives smart people away from the riff-raff. It's not a desire to distinguish oneself from everyone else; it's a desire to create and to commune with smart people. Maybe that is snobbery, but it is not based simply on trying to create an appearance of superiority. It's a desire to have a little fun.
Glass-Cockpit Archer III Checkout
Today I got checked out in the school's 2005 Archer III. After a year of training in 25-year-old Warriors, it was a pleasant experience.
In aviation parlance, a "checkout" is a supervised flight where a pilot demonstrates to the satisfaction of the plane's owners, operators, and/or insurers that the pilot can be trusted to fly the plane. The FAA isn't involved in this. As far as the FAA is concerned, it's legal for me to fly any non-turbine single-engine plane under 12,500 pounds (with a few other qualifications), but airplane owners and insurance companies aren't going to let me get in a cockpit without a checkout. So I flew around with one of the instructors for a couple of hours while he demonstrated its systems and had me perform touch-and-goes, stalls, steep turns, and other maneuvers. Now, I'm allowed to rent the plane whenever I want.
The Archer flies a lot like the Warriors I trained in. The Archer is a little heavier, but has a more powerful engine. The Archer's stalls were a bit gentler than the Warrior's, and the controls felt a little stiffer, but on the whole it felt a lot like the planes I'm used to.
Landings were a little difficult because the Archer's instrument panel is higher than the Warrior's, causing the sight picture in a flare to look different. After a few touch-and-goes, I got the hang of it.
This Archer has a "glass cockpit." That has nothing to do with the material in the cockpit windows—it means that instead of the traditional analog dials, the primary instruments are two large computer displays. The display on the left, called the Primary Flight Display (PFD), provides the functions of an altimeter, airspeed indicator, vertical speed indicator, turn coordinator, horizontal situation indicator, tachometer, and a few other things. The display on the right, called the Multi-Function Display (MFD), can be switched between engine monitoring, a moving map, and a few other functions. In addition to the two big displays, the plane has GPS receivers, Traffic Alert/Collision Avoidance System (TCAS), satellite weather, an autopilot, some fancy radios, and other new-fangled stuff.
And it has leather seats. Those were nice.
I really didn't make much use of the nifty gizmos. I'm sure they would be useful when making a cross-country flight, or when flying IFR, but when just tooling around the practice area, I think I would have been happier if it all had an OFF switch.
As a software developer, I was shocked by how hard it was to use all this stuff. The avionics system is made up of several independent components, and they way they were integrated presented a confusing user interface. It's a bit like when you want to switch from watching cable to watching your DVD player: you have to use one remote to switch the TV's input channel, then another to turn on the DVD, and then a third to adjust the volume on the stereo. Now imagine how that would work if, instead of keys to press, the remotes had knobs to spin. Then imagine you are using those remotes while riding a unicycle. That's what the glass cockpit felt like to me.
This is the kind of thing that makes people hate computers. There's no excuse for it. It's just stupid.
I'm not against glass cockpits. I just think it will take a couple more iterations before small airplanes have systems that are easy to use. In the meantime, I'll be happy with the old "steam gauges."
But while I don't need glass, I definitely do need leather seats, so I'll be flying this plane again.
Sunday, March 05, 2006
Finding Time to Fly
In November 2005, my final month of private pilot training, I had twelve flights. In December, when I had my license and was working only part-time, I had six flights. Since the beginning of the year, I've only had two flights: one at the end of January, and one today. This isn't good.
There have been a couple of weekends when I wanted to fly, but couldn't due to weather. However, the lack of flying is really due to lack of time. When I was working part-time, I could fly a couple of times during the week and still have my weekends free for other stuff. Now, I have to choose between flying and "other stuff" on my weekends, and the latter usually takes priority. Flying is fun, but not as much fun as hanging out with family and friends, or taking a long afternoon weekend nap.
I'd like to start training for an instrument rating, but I really can't do that with my new work schedule. I'm going to be traveling a lot in the next six months, usually on short notice, so I can't maintain a reasonable training schedule. I suppose I could spend my evenings in hotels studying instrument stuff, but without actual flying to go along with it, it will be difficult to absorb the material.
I really don't want to be one of those guys who flies only a few times a year. They scare me. They do dumb things, like overflying Washington, DC without an appropriate flight plan. If I can't find a way to meet my twice-a-month goal, it would be a lot safer to just give up flying.
Life would be a whole lot nicer if I could just have everything I want, and an infinite amount of time to enjoy it. Why can't it work that way?
Friday, March 03, 2006
Ooh, That Smell
When I returned from a two-week business trip, I found a strange odor in my apartment. I assumed it was just stale air, and hoped everything would get better when I turned the air conditioning back on. It didn't. It's a dusty, musty sort of smell. It's not really a strong smell, but it's not pleasant.
I've checked the fridge, the garbage, the toilets, the sinks and shower drains, and every other potential smell generator in the place, but none seems to be the source. There's no room where the smell seems stronger than anywhere else.
I've used a lot of air freshener, but the smell keeps returning. I'm starting to suspect it's something in the ventilation system. Maybe something died in there.
Before I take the step of calling the apartment management, I'll take even more drastic action: I'll clean my apartment.