I think many people are afraid to make major changes to their underlying code, though. They fear causing new bugs. This is a legitimate fear, and definitely should be considered.

Thank you, revdiablo, for the seed of another Meditation.

While I totally agree with the sense and sentiment of your orignal reply (Design opinion, configuration inheritance), I would argue that if one is afraid to make changes to the underlying (structural) code, then that is the time when one REALLY needs to sit down and restructure the code to clarify and clean it up. Besides pure readability, many bugs will fall out when you shake your code vigorously!

Separating decision logic from action logic is important. Providing clean distinctions between control sequences and data manipulation gives you a really clear picture of what you're messing with at any given point in your program, and why.

I, of course, bite myself regularly with this one, and this Med surfaced because I woke up in the middle of last night worrying about whether I'd trashed a data variable I was merrily carrying along through a control sequence just because it was easier and more efficient to extract before the sequence started.

Taking a wrecking bar to one's code regularly leads to better sleep AND better code! :D

UPDATE: I want to clarify (thanks, hardburn!) that this rewrite activity is intended as part of the creative process, NOT that breaking production code is a good idea!!!

In reply to Structural Elegance by samizdat

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.