« | Home | »

Refactoring is fun

By Sparky | December 28, 2007

During the last couple of days I’ve been toying with Traskpro development tasks while I’ve been home ill. Until today I didn’t actually implement any new functionality, but rather spent my time re-factoring ‘old’ code from the 0.1 and 0.2 versions. Re-factoring is a low strain on my brain and a great task for idly doing while drifting in and out of sickly sleep – once I got the new architectures and designs on paper implementation of the new pattern happened on a feature by feature basis.

Most notably I took a lot of hacky if loops to select SQL queries and moved them into a net-new function which builds the queries based in inputs so the code is both easier to read and easier to maintain long term. I also moved a lot of in-line functionality to within functions which has made long term maintainability and new feature development a breeze.

Not only does this re-factoring provide more readable code, but having everything generalized into functions made adding a few new features a breeze. For instance I just added a capture feature to Traskpro for capturing more than one task (and tag array) at once. This makes capturing action items in a meeting brain dead simple and removes the need for a round trip to the server between each individual addition. Because of the functions for adding/editings tasks, or adding tags to tasks this new feature was developed in a far more efficient fashion – rather than building from scratch I could re-use code.

Simple stuff I know, but not developing for a living really does give me appreciation for elegant, maintainable, and readable code.

Share and enjoy:
  • email
  • Digg
  • del.icio.us
  • Fark
  • StumbleUpon
  • Technorati
  • Facebook

Topics: Development, Internet, Open source, Software, Technology | Comments Off

Comments are closed.