Ahh, so this is why you refactor. Move your model and controller code out and away from your view code, and you'll be able to test each independently.

The more you describe your system, the more I wonder how much time I would waste in maintenance coming in after you if you had left. It sounds like a nightmare.

I got this quote off a mailing list a short time ago. I think it fits:

it was the sort of code that made grown men cry.

He saw it and knew then that his life would never be the same. Gone forever were the nights spent with friends in the pursuit of manly activities, replaced with curling under a blanket with a bottle of cheap vodka mourning a more innocent age, an age before his bad code deflowering. As he looked at the code, he resigned himself to the therapy, the drugs, the late-night waking-up-from-nightmares-drenched-in-sweat-and-screaming that lay ahead, and started contemplating the only other avenue open to him now -- an easier, so much easier avenue. If only suicide was not an unforgivable sin in the Catholic church ...

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.


In reply to Re^7: Speeding up RecDesent parser for Perl Code by merlyn
in thread Speeding up RecDesent parser for Perl Code by Outaspace

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.