Settings

Theme

Ask HN: How often do you use code generators in your software projects?

4 points by mbrizic 4 years ago · 2 comments · 1 min read


I'm asking this as it seems like a really common pattern in projects that I worked on.

It usually goes like this: system architecture gets complex and elaborate enough that new features/modules require developers to manually copy and paste 5-10 files from the similar feature as a starting point. Most of that code is not even related to task you're trying to solve, just a general boilerplate to fit into existing architecture.

So a custom code generator gets written to ease those efforts.

To me it seems like inevitably every bigger project comes to this phase and we end up writing a generator for it. In fact, I'm working on one right now.

Wondering what are the other people's experiences with this.

ffwacom 4 years ago

Yes, it’s the only way to manage complexity. Been using Clojure and CL, basically everything is done with embedded macro DSL’s.

pfdietz 4 years ago

I use Common Lisp, and macros there are code generators. So, every day?

Your experience seems to be an example of Greenspunning.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection