Giving Code a Spring Cleaning

The better part of last weekend was spent performing a fairly large-scale spring cleaning of my house. Of course, visiting family arriving today was a great incentive! But just like cleaning and tidying a house, I really need to spend some good time spring-cleaning the actionscript code in the various medical websites and healthcare IT applications I have been working on, namely the new DDA Medical website.

Just like we do at home with mail, magazines, receipts, shoes and clothes hastily placed creating clutter or often making it frustrating to locate an important bill or phone number, the same goes with code, my coding anyway. One method I use is to separate code into different function related actionscript files which individually get loaded into the Flash application during the publishing. Even with this approach, many variables and functions manage to find themselves in files that they perhaps don’t necessarily belong in.

With Flash actionscript, one can create custom classes to reuse and organize code in various applications. Thing is, most of our projects are so individual and custom-made that hardly any code is reused without some alterations. Cleaning and reusing code decreases file size, literally bit by bit, but also makes it a lot easier for a fellow programmer to pick up the project and make modifications or additions.

Well, the house is clean and ready for our two VIP visitors, my mum and sister, but I’m glad they aren’t visiting my actionscript code — arrays, functions and variables are still all over the place waiting for their spring cleaning.