views:

388

answers:

13

If you use one of course, which one?

  • MyGeneration
  • T4
  • UML Transformation Tool (precise which one)
  • ...
  • All others not listed above since there are so many
+1  A: 

I tend to avoid code generation and generate dynamic functionality at runtime, using either C# DynamicMethods or C# Lambda Expressions... I prefer not to have generated code in my solutions...

LorenVS
why? you love typing all that boring, repetitive code manually?
marc_s
It's only boring and repetitive if you're doing it wrong.
Charlie Salts
In the traditional app, there's an absolute TON of pretty boilerplate code -- why on earth would someone want to rewrite that every time? Perhaps you work on something very specialized and/or new each time LorenVS?
DarkSquid
@Charlie, not always your language of choice can abstract you from repetitive code and even if it can, it might not be practical for performance reasons.
lubos hasko
Code generation has one important merit - you can see what you generate. But generally, metaprogramming and metaobject protocols should be the right way imho.
Gabriel Ščerbák
+15  A: 

Do my hands count? :)

Matthew Jones
+1 awesome comment
LorenVS
Notepad
Velika
+2  A: 

CodeSmith Studio - lots of great sample templates that work with it.

TLiebe
excellent tool - I gave up on T4 and went back to CodeSmith after T4 templates weren't able to be configured to pick a server/database/table as properties, rather than hardcoded in the template code...
marc_s
+3  A: 

Eclipse EMF and JET.

Stephen C
While JET is popular, it's also not very powerful. For example, OAW/XPand supports aspect templates, so you can extend or replace existing templates; it is also based on a meta-model. EMF uses JET for its code generation, whereas GMF uses OAW/XPand for its code generation; the latter is significantly easier to extend or modify.
jevon
A: 

I just started playing with the code generation features of Enterprise Architect. It's nice having code generated from the model instead of the database layer, but unfortunately their code-gen tool is a bit unwieldy. So far I've tweaked its C# template to produce bare-bones CSLA classes which at least saves me a lot of typing.

David Peters
A: 

Jeeves (discussed in Advanced Perl Programming).

I have a pre-build step in VS 2005 that executes Jeeves to produce source code "just in time" for compilation/linking.

John at CashCommons
What is Jeeves can't find any link ?
Rebol Tutorial
A: 

I often write code generation scripts in Python. In the distant past I have also used Perl. Either language is well-suited to the task.

Imagist
Do you use python to generate python or something else ?
Rebol Tutorial
I use Python to generate Java. It's worth noting that I am not generating classes from UML or anything like that; I am generating classes that contained large numbers of constants. This meant that we load constant data using the classloader instead of reading it from a file, which allows us a speed boost (the embedded system we work on has a poorly-implemented version of the JVM; many base classes have to be avoided because of poor performance.
Imagist
+2  A: 

"Normal" code-gen tools I use that many people don't think about:

  • Windows Forms designer
  • XAML for WPF UIs
  • LINQ to SQL

Other code gen tools that are obviously code gen in the project:

  • ANTLR
  • Custom tools I wrote such as one that turns an Excel spreadsheet (File.xlsx) into code (File.g.cs)
280Z28
A: 

DMS Software Reengineering Toolkit

Can be configured to read any style of specification language, and generate code including post-code generation optimization.

Ira Baxter
Link doesn't seem to work now.
Rebol Tutorial
Website was down temporarily. Link works now.
Ira Baxter
+1  A: 

I'm using the following code generators:

  • Visio Enterprise Architect for generating SQL scripts for creating and updating databases
  • NConstruct for generating NHibernate mapping files and sometimes for generating "first draft" of an application
  • Visual Studio for generating UI design files, project and solution files etc.
  • Jet Brains Resharper for lots of code snippets, template based chunks of code etc.

I believe my productivity would be much lower without code generation tools. Code generators usually don't produce bugs in generated code so this is also a good reason to use them.

Leo
A: 

I use for generating code from UML:

  1. Visual Paradigm for UML
  2. Netbeans IDE + UML plugin

For editing/ generating GUI's:

  1. Netbeans IDE
  2. MS Visual Studio

For anything else

Python (because I find it's just the quickest way to hack something together).

bguiz
+2  A: 

Eclipse Xpand and Xtext, also known as openArchitectureWare.

Fabian Steeg
openArchitectureWare exists no more, all subproject have become part of the Eclipse Modeling. The toolchain contain Xpand, Xtend, MWE and Xtext.
Gabriel Ščerbák
@Gabriel openArchitectureWare still exists as an Eclipse working group (see the link in my answer).
Fabian Steeg
That is true, I just wanted to stress, that there is no software under that name.
Gabriel Ščerbák
A: 

i use own generator jUle

http://code.google.com/p/jule/