This is a very interesting subject, and I'm always surprised that Perlfolk don't deal with this more often since Perl has great text manipulation built-in and available world class templating systems.

That said, I strongly disagree with keeping generated code in the source control system. In my experience this winds up getting out of sync with the actual state of the project. Developers should be aware that changes are being made to the generated code, and the best way to make them aware of this is when they need to compile additional files whenever they build the project. Smart code generators will not regenerate a file if it has the same content as one that already exists, which will lessen or eliminate the "having to recompile" everything problem.

I think the other conditions you speak of here indicate a code generation system needing repair. (I hesitate to say "broken" because it clearly functions, but suboptimally.) If people are treating the code generator as a black box then they need to understand the parameters for changing the generated code: how easy is it, what are typical changes, etc.

I'm ambivalent about whether all developers need to know everything about the code generation system. It would be a great situation if they did and prevent the 'guru getting hit by a bus' problem, but most often there's simply not enough time.

As usual: according to my experience, with my two cents, etc.

Chris
M-x auto-bs-mode


In reply to Re: Code Generators as tests. by lachoy
in thread Code Generators as tests. by dpuu

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.