Skip to content
September 8, 2006 / Bob Black

Code Toaster

I’ve been working on a little piece of software for a while now that I’m fondly calling Code Toaster. It’s a code generator, you see, and the idea is that it spits code out like a real toaster spits out toast.

Many coders have mixed feelings about code generation, but after coding the same old data access code 100 million times, I began to think quite fondly of any method that would automate some of the tedium. I had used CodeSmith before, but it’s biggest pitfall (in my opinion) is its like lack of Intellisense support. I wasn’t too fond of flipping back and forth between the documentation and the CodeSmith IDE to try to figure out how to create a new property directive, or get database schema information. I suppose I’ve gotten a tad lazy with Intellisense’s instance gratification and all, but in my humble opinion, getting a code generation template up and running shouldn’t require much more thought than it would to just write the code the old fashioned way.

So I rolled my own tool, built from the ground up not just to generate code (and lots of it), but to make it easy to generate code (specifically, to write the templates that generate code). Full intellisense support (somewhere between the quality of VS.Net 2003 and 2005), and a handy-dandy IDE with common IDE features, like snippets and whathaveyou. And coolest of all…

You can compile templates into a .Net assembly!

No way! Yes way! This means you can easily reuse Code Toaster templates in other .Net projects, which would make it easier to, oh, say… make software-generated emails look snazzy. Or, convert from one file format to another, and just all kinds of stuff. I’m excited.

“Gimme it!”, you say. Well, I ain’t done yet. Gimme a few more days, or, more likely, a couple of weeks, and I’ll put da candy in yer hand. Or should I say, the toast.


Leave a Reply

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

You are commenting using your 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

%d bloggers like this: