views:

156

answers:

7

I've been using some Sonic and NHibernate and NetTiers. What else is out there and how do they compare?

+1  A: 

CodeSmith is quite good.

JP Alioto
Just curious why neg codesmith? Bad experiences?
JP Alioto
I didn't neg it, but if he's already using NetTiers then he's probably using CodeSmith... Though to be fair, NetTiers != CodeSmith so it still should be a valid answer...
GalacticCowboy
+3  A: 

Well, maybe it's not very cool, but I've been using fprintf to generate code ever since I learned C.

Mike Dunlavey
I've used that style of generation before; with Ruby, the built in eRB engine is great for code generation.
The Wicked Flea
Hey, somebody, thanks for the downvote :-) Nothing is more boring than stuff that everybody agrees with.
Mike Dunlavey
+1 to compensate for the -1.
Chris Lutz
+1 I've generated code from SQL, Excel, TextPad, ...
GalacticCowboy
A: 

The GWT compiler is a cross-platform, optimising, Java-to-JavaScript code generator.

Robert Munteanu
A: 

On the unix side of things, autogen is pretty good: http://www.gnu.org/software/autogen/

I often use it to do poor man's templates in C (templating over float/double/long double), but it can do some pretty advanced things too.

David Cournapeau
A: 

How about this (reasonably) definitive list: http://www.codegeneration.net/generators.php

As for comparison, ultimately only you can decide if you want (or need) to adapt to the code they produce, or how much time you want to invest adapting your own style to align with what they produce. For example, some developers here used LLBLGen for a while, but we have since abandoned its use as its output didn't align particularly well with our own coding standards. It wasn't bad code, just different.

Paul Suart
Seems a slightly drastic reason to abandon LLBLGen. a) You should hardly ever need to look at the generated code anyway and b) why not just modify the templates to make it match what you were after ?
Matt
A: 

I hear a lot about MyGeneration. I have also used ActiveWriter for CastleProject but it is a bit specific, not unlike subSonic though, which is more of an orm. (Activerecord uses NHibernate, but this is a tool to generate your classes. As for generating classes, there is a built in class diagram system in Visual Studio to get you started.

Limesoda
+1  A: 

I've done a couple projects now where we used T4, which works pretty well and is built into Visual Studio.

GalacticCowboy