I bought CodeSmith back in v2, but I was so busy I never got a chance to do more than play around with it. So now v3 is released, and I was looking at the improvements (like Intellisense) and decided I would take a look at it again. Boy, was I glad I did..
Don't get me wrong, I wasn't putting it off because I think code generation and templates are bad. In fact, quite the opposite. When I first started my business, I had a few people working with me part-time, and then finally full time as the business grew. What I found was that in the end, I apparently hold my coding standards to a higher value than others and I would end up coding 90% of the application myself. I realized quickly there were a few huge advantages to automated code generation. Here's a few:
- Fewer errors (as long as you fix the templates as errors are encountered)
- One developer can do the work of 4-5 once you get a good architecture set up
- Standards enforcement is a no-brainer when you are all working off the same templates
- You can spend more time on UI usability and data structure because 90% of the infrastructure stuff is done automatically
- Changes are easy. Change the structure and regenerate the code, and you are off again.
I could go on and on about it. I had written a series of VB6 addins which I used based off Rocky Lhotka's BusinessObjects book for VB5. In hours I could generate almost all of my middle and data tier code. A tweak here and there, and I was doing the fun stuff like UI coding.
Along comes .Net, and my addins were irrelevant. I created a couple of quick and dirty addins, but I was so busy heads-down coding, I didn't have time to create new templates to reflect the impact of .Net. I did create some common libraries of functions which got me through a good chunk of redundant coding, so that was going to have to do the job for the time. I had always intended on going back and re-coding some new templates, but it never happened.
I am currently working on a project and we are horribly understaffed, and there's no relief in sight. There are some huge deadlines coming up, and it's time to make the rubber hit the road. I already code fast (and tight), but I needed to clone myself a couple times over to make the deadlines. So when the announcement came this week of CodeSmith 3.0, I decided I would take a new serious look at it and see what it could do for me.
Holy crap! In a matter of hours I had some pretty solid templates up and running, which will save the team many, many hours of redundant coding tasks in building this application. I have so many ideas for new templates it's scary, and I have only scratched the surface for what the tool can do. If you haven't looked at it yet, I recommend immediately going to CodeSmith and downloading a trial.