Today I’ve decided to work on BSS again - finally.

And I’ve even come up with a few neat bullet points to help me clean-up the codebase and I really feel like sharing them with the world today (although everybody can come up with them in a few minutes, too, but hey - now I can say that you’ve only copied my thoughts :-P):

How to fix and clean-up stuff quickly:

What do I want?
  • remove unnecessary code
  • clean-up the design
  • untangle tight couplings

How do I do that???

Hack & Polish

  • look at a specific code section
  • rewrite it quickly while keeping the behavior the same
  • don’t look at the overall design concepts - to KISS (to keep it simple STUPID)_
  • as soon as the new code actually seems to work, go and polish it slightly (to make it readable again)

Repeat these steps a few times..

Now look at the “overall picture” and try to identify common patterns and remove duplicate code again by writing generic helper code - but this time keep it decoupled and make it less messy!

Rinse and repeat…

OK… sounds great? Yes, it does! And it even works to some degree. I’ve tried it this evening and although I - like always :-( - lose too much time browsing around and getting lost in the WWW, I still made some progress.

Here’s my worklog as proof (and to tease Joshua a bit ;-P):

18:32 starting to work on BSS's cleanup
19:20 removed some Sploidz-specific code from the items module
20:00 removed more files, tracked down Joshua's new coder (wtf didnt he tell me?!?) and found out that two files were missing in the SVN repository (added them from a backup that I have with me here)
20:30 changed bits of EventFSM and t2dFSM
21:00 reworking BlockItem
21:45 BlockItem now uses a FSM
22:45 BlockGame now is decoupled from Grid (gamelogic-wise) and BlockItem from BaseItem (the latter might be reverted later though)
23:00 trying to rewrite BlockGame's setupItem function again but deciding that it's pretty late

Enough for today. One more Dexter episode for me now (actually the first today) and then good night!

Good night,
Black