View RSS Feed

Tynian

(Re-)Factoring in Diversions

Rate this Entry
I was hanging out visible online last night, and someone asked me whether random sanctuary potions were still popping, because he hasn't seen any for months. I didn't have anything else going on at that moment, so I looked into it. By and by, random sanctuary potions still pop - I found one last night.

As part of my investigation, I also looked at the code responsible for creating random potions. It was written circa '93/'94, and it's a mess. The more I looked at it, the more unpalatable it became. I haven't heard of the term "code smell" before I started writing this post, but it is certainly describes my reaction to the random potion code. I've decided to re-write it. Re-writing bad code is called refactoring, and while it doesn't add any neat new features (true refactoring doesn't change what a function does, just how it does it internally), it is a necessary activity for improving maintainability of the code.

I couldn't resist making adjustments to random potions. I was in there anyway, after all, so perhaps just a tweak or two. You can expect two things. First, different types of random potions will pop. Also, a few of the colors have changed. This isn't a wholesale re-shuffling of colors. I just didn't like some of them. And I wanted to move sanctuary back to its traditional color.

Submit "(Re-)Factoring in Diversions" to Digg Submit "(Re-)Factoring in Diversions" to del.icio.us Submit "(Re-)Factoring in Diversions" to StumbleUpon Submit "(Re-)Factoring in Diversions" to Google

Tags: None Add / Edit Tags
Categories
Version 5

Comments

  1. Cordir's Avatar
    I really like the new changes. Thank you, Tynian!
  2. Belsambar's Avatar
    I looooooove the new potion code tweaks. Super awesome, and I've been having a blast with it...

Trackbacks

Total Trackbacks 0
Trackback URL: