Hacker News new | ask | show | jobs
by mrkeen 2101 days ago
> What happens when this generated code has a bug?

That's a bug in the generator and should be treated as such. Patch or throw out the generator. It's not sustainable to review and patch "generated code", because then it's just "code".

The only reason I need code-on-disk is if I need to generate bindings into multiple languages.

1 comments

But looking at the generated code, in the specific context where it was produced, is possibly a key step to understanding the bug in the generator. How else are you going to understand how to patch it, or whether the it's bad enough that you have to "throw out the generator" (if you can afford to do that)?
I misspoke when I said "Patch [...] the generator." I meant to say "Have someone else patch it". I meant to imply your time is too valuable to look at the intermediate source.

I'd drive a car to work to save time. If I have to get out and push the car instead, that's happening no more than once. I ditch the car, because it no longer saves me time. Getting out and pushing the car is not going to become part of my commute, and I'm not going to evaluate future cars on how easy they are to push.

You can afford to throw out the generator because it doesn't claim to give you new functionality. It just cuts down on boilerplate. If it can't do that properly, write the boilerplate.