Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Don't write code generators for high level languages. Use reflection if you must, dictionaries if you can.
-
Expression trees, the emit namespace, roslyn, t4 templates, dotnet scaffolding. The options border on legion.
-
Look up stringbuilder, abstract syntax tree, recursive generation, or just use a language where a data class is
@highlight
class A(b: Int, c: String) -
Okay.
But you're literally writing that in an IDE with a Code Generator included.
Wrote a REALLY bad, simple java method to generate the repetitive parts of c# classes
Now I’m curious about good code generation methods. How I probably should’ve done this
Think I could get some advice and links on how to start learning to write simple code generators?
rant