PLACE YOU BETS NOW!

lgfp1105.jpgHappy host coder bags big surprize after manic midnight code culling!

Imagine my surprize when my little cleanup project manifested results like this:

Before:

-rwxr-xr-x 1 osmith osmith 6691793 Nov 20 04:00 sdmParser
-rwxr-xr-x 1 osmith osmith 5284768 Nov 20 04:01 stratValidator

After:

-rwxr-xr-x 1 osmith osmith 21484 Nov 20 15:17 sdmParser
-rwxr-xr-x 1 osmith osmith 132456 Nov 20 15:17 stratValidator

Question is! Will it work? Place your bets now!

12 Comments

You’re funny. You didn’t readed the Murphy’s laws of coding, isn’t it?. You are way optimistic, but this feature is a good thing for your mind health.

I bet that Murphy is right :-)

I’m with Murphy.

Put that in non-coder Engrish? So that teul cancer you cut out gave you something smaller? Just a guess..

Oliver,

Are you English or American. Surprise is spelt with an “S”!!

GJ on the reduction, but Murphy gets my vote.

Both of them work perfectly, even slightly faster than they used to do – although not immensely, and they’re not exactly tools we use daily.

The hosts and other apps lost a little weight too – I finally managed to corner and eliminate the last implementations of the AVL tree code that was all written in C and cantankerous (sort of a self-organizing list intended to minimize the amount of time you spend looking for something, such as ‘where is the data for player 1234?’). Because it was implemented skeletally, we had to write custom AVL-management routines each time we used one, and we used to use lots of them.

Switching to using the Standard C++ templates (which weren’t so standard in 2001) allows me to replace 200-1200 lines of AVL management code with:


void registerPlayer(Player* player)
{
playerHash[player->playerID] = player ;
}

void unregisterPlayer(const Player* player)
{
playerHash.erase(player->playerID) ;
}

Player* findPlayer(PlayerID playerID)
{
PLAYER_HASH::iterator it = playerHash.find(playerID) ;
return ( it != playerHash.end() ) ? it->second : NULL ;
}

plus some comments for good behavior. (Actually, that’s pseudo code, so don’t go nit picking it ;-P)

Weren’t you doing this kind of stuff .. oh .. before I left? :)

I distinctly remember your beaming with pride at removing some many thousands of lines of code. Admittedly, it was some pretty heinous code.

STL is just the bomb.

That is greater than a power of ten reduction.

I don’t know what they do – but they must do it faster now.

….and THUNDER is a buzzkill. :P

Was pay based on lines of code at one point? :)

Yeah, I was :) But I’ve been adding code for a while again, and I just got tired of having to use ‘vim’ as my IDE. Typing things like ServerInterface::PlayerStatusNodeByTeulIndex(dispatch->teulIndex) gets a little tedious when cut & paste or autocomplete could do it for me ;)

I’ve also consolidated the map, chat and cell hosts to use a class called Player instead of Client, Persona and MapPersona :) I ought to derive them from a common base, but I’ve got real work to do first.

I’m not a coder, but I CAN say with some authority that those lines of code were written in the colour green.

Trout

Use red crayons, red is faster! :)

Awesome. Clean, simple and functional, as every software SHOULD be.

MWAHAHHAHAHAHA, poor of us :/

Leave a Reply

Name and email address are required. Your email address will not be published.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

You may use these HTML tags and attributes:

<a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <pre> <q cite=""> <s> <strike> <strong> 

%d bloggers like this: