in reply to Re^2: (OT) Generated Code vs. Libraries
in thread (OT) Generated Code vs. Libraries
Anyway, both of you seem to be implying that I said something like "generating anything from anything else is always bad." That's not what I'm saying at all. Let me try to re-state it more clearly:
In most cases where you could use code generation to solve a problem, you could also use a data structure and some subs to solve it. To quote from the wiki link I posted, "Anything you can do by generating code, I can do by calling data driven subroutines." Using subs is better because it is easier to understand (no need to parse two-levels of code at once in your head) and avoids the danger of hand-editing.
I'm not claiming that there are no situations at all where code generation is required. A common reason to use active code generation is the performance gain you can sometimes get with it (e.g. templating systems often generate perl code from templates).
Even if you completely disagree, the wiki link I posted is pretty interesting reading, and makes good points on both sides.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: (OT) Generated Code vs. Libraries
by hv (Prior) on Oct 24, 2004 at 10:34 UTC |