Writing Code That Writes Code

Taking a tip from the Pragmatic Programmers (specifically tip 29 from The Pragmatic Programmer book), I wrote an article for TopCoder titled "Writing Code that Writes Code." Relating code generators to woodworking, Dave Thomas and Andy Hunt present strong examples of how developers can benefit from using code generators. When a developer is faced with a repetitive task, a code generator can help make that task easier, with less chance for error, and allow the developer to focus on more important tasks.

Essentially, that is what I set out to do for the TopCoder developer community. Stored in a standardized XMI format, the component designs are all created with Gentleware's Poseidon. Using the application attached to the article, a TopCoder developer can start out with a much better code skeleton than the one generated by Poseidon. This allows a developer to focus on implementing a design, rather than massaging code templates or keying in a code skeleton from scratch.

One other point this article really demonstrates is how useful it is to use components in development. TopCoder uses components to develop software for their clients, enabling them to have possibly 50% or more of a client's application written before they even start. Indeed, using a couple TopCoder components in the xmi2cs application greatly reduced the amount of code I had to write.

I hope to be able to keep xmi2cs up-to-date and add periodic enhancements, but that is pending approval from TopCoder due to licensing on their components. However, I have been working up some great ideas for another project I have been neglecting, and I am excited to implement them.