Maintainable Code

Maintainable code is essential to the easy maintainence and running of a MUSH throughout all the difficulties it will go through (wizard changes, servers failing, code failing). When I talk about Maintainable code, I mean code that:

This may seem like a tall order, especially considering how little documentation is usually done on major systems code (I'm guilty of this myself).

Readable Code

Code needs to be written readable because you will not always be the only one working on your code. Many authors (myself included) are willing to share their code in an effort to help the general MUSH community, and that means other people will be working on it. Just like you wouldn't want a stranger coming into your messy home, you shouldn't like distributing messy code; it tells people you either don't bother or aren't capable of writing clean code.

Readability eases other's maintainence and modification of your code, as well as bug tracking and reporting. Sometimes readability means your code will be slightly slower, but unless it is a really time-sensitive code, that's probably not a big issue.

Documented Code

There are two types of documentation to talk about, help files for how to use your code (commands or interface functions), and documentation that tells how the code works internally.

Most people write the former type of documentation for their code, but not the latter. The latter is important for the same reasons that readability matters -- sooner or later someone else is likely to be working with your code. Documentation in the code (via the @@ command, or a comment() function which I'm going to add to my mush and submit as a function to add) is very important, especially when you are doing strange and convoluted expressions or code strings.

Usable Code

Usable code is code that is easy to use; easily remembered commands, logical commands ('+look' works like the builtin 'look' does), and useful commands.

Easily remembered commands often associate English phrases or ideas with the commands, some examples such as '+wield object' are common throughout MU*es and other text-based RPGs. Hard to remember commands include stuff such as two separate commands to do the same action, such as '+air' and '+fly' for a space system ('+air' only works in atmosphere, '+fly' only in space).

Logical commands go hand in hand with easily remembered commands. To speak in a language, it's logical to '+speak ', whereas something like 'talk in ' is not logical (commands usually don't have spaces in them).

Useful commands are really the only type that should be coded and put in the master room. You don't need thousands of little silly commands like +wink, +hi, etc. All those do is slow down the server. If players really want those commands, let them define them as macros in their client or go without.

Administratable Code

The meaning of this section may not be instantly clear to you. Administratable code means that somebody else, who doesn't know the internal workings of your system should still be able to administrate the whole or part of your system with no trouble.

For example, the Judges who can rule on combat matters should have a way to easily kill or heal a player without resorting to using IC commands like +attack/+heal. There should be a special '+jkill' command that allows a Judge to instantly kill any player (died falling or some other RPed combat/damage) and another '+jheal' to allow the judge to heal a player.

 Home MUSH Theory Sitemap