Rants, rambles, news and notes from another geek

Code Generation

OK, so I’m a bit late to this discussion…

After reading John Lam’s posts (here, here and here) about using Code Generation as a primary code development technique, I realized that I was heading this way already.

I remember&nbsp_place_holder;when Develop’s GenX came out. At the time I didn’t really understand. But sometime in the last 10,000 lines of code, I got sick of writing the same code over and over again. Before you start hollering about class libraries and such, understand that I’m talking about the “other code”. Class libraries are great and we all create them (especially if we strive for 4LF), but when you are creating Data Access Layers, typed collections, and other things like them, you need a better tool.

I’ve written custom languages that use simple YACC/LEX parsers to produce C++ code for me, and I even found some similar tools for .NET (although I can’t seem to find them right now). I currently use Chris Sells collection class generator and a few other simple tools, but after reading John’s article, I must say I’m very interested in GSLgen.

I’m also entranced with the idea of generating an entire application using abstractions and generated code. Wait… isn’t that what C++ was back in the old days? Just an abstraction than produced C code?