litany against fear

coding with spice ¤ by nick quaranto

Why every programmer should play NetHack

published 29 Oct 2007

I have a place in my heart for an obscure text based game called NetHack. This game is an archetype roguelike game, and I’ve been playing it for over a year now. Not a year in actual game time (yes, I used to play WoW, a lot), but I’ve been into NetHack seriously for the past 6 months or so, and it still kicks my ass. However, I’ve managed to ascend (beat the game) twice, and I can even play it on my Motorola Q.

How has such a game captured my attention for so long and directly apply towards my career as a software developer? Let me enlighten you as to why I think you should play it, and why it still matters so much.

NetHack is HARD.

No, this isn’t really a reason to play the game. However, it is a testament to how NOT to make your software. The amount of frustration I’ve had to go through in order to ascend has been utterly ridiculous. Hell, when I first started playing the game, I didn’t even know there was an ending. I just played because I like to explore. A classic idiom in web development is “Don’t Make Me Think!” I had to do completely the opposite in order to get anywhere in NetHack. One has to remember what monsters do, not to put on that piece of armor because it might be cursed, not to drink from that fountain because snakes might pour out and kill me, and so on and so forth. Well, perhaps under the thousands of lines of C that compose NetHack, someone didn’t think about that, but I for damn well sure am not going to make sure whoever uses my program won’t have to think twice about performing actions.

After 20+ years of development, it still has a vibrant community of users.

This really should be the goal of any community online going forward, be it you’re creating a forum for users of your software to request features, or you’re making a wiki-based community, or any of the above. Where will your community be in 20 years? Will it have vibrant fan-made sites? Will it have a fleshed out wiki? How about a newsgroup? Or will it fizzle and be forgotten? The lesson here is that in order to make your community bloom you need to first plant the seeds. Dig in a bit and you’ll find that behind this game of ASCII characters and telnet terminals there lies a deep and invested group of users passionate about the game and willing to help others how to play. If it wasn’t for the community and the “spoilers” it offers, I’d probably still be wandering around the Dungeons of Doom aimlessly.

“The DevTeam thinks of everything.”

This is a classic motto of NetHack’s development team within the community. The level of complexity of the game is ridiculous. Allow me to elaborate on one specific monster, the cockatrice. This monster is one of the most feared in the game because it can turn you to stone. Ah, but here’s the rub: once slain, you can wield its corpse and stone foes. And this is where the DevTeam starts thinking. You picked it up with no gloves on? You turn to stone. Oops, you tripped down some stairs because you were carrying too much? Stoned. Hit the wrong key and now you’re eating it? Bam, stoned. The list goes on, and on and on. However, the point is clear: the people behind NetHack have really thought of every possible case, every possible scenario in the game, and there’s a consequence or action for it.

I tend to strive for this goal now when I’m coding. I’d be proud if my program was so robust, so tested, and so mature that it could be said that I thought of everything. And even then, that’s still a long shot, perhaps even impossible. In the short term, I find myself trying to think of every possible case that I can while I’m programming, and I hope someday I’ll be known to be able to really “think of everything.”

Not convinced yet? Check out these old articles from GameSpy about NetHack. And if you’ve played NetHack (and/or if you’re a coder), leave a comment and let me know what you think about how NetHack relates to your other 9 to 5 job. And for those of you concerned, there are several GUI versions of the game in the case that you’d rather look at pretty pictures instead of characters.

email twitter github