vladb++

Another problem that hit me sometimes is the question "Hi Martin, could you just write a script for doing xyz? Takes you less than 30 Minutes? Yes, afterwards you can throw it away, we won't need it any more..."

When the script is running somehow, enhancements are required. "... just this little enhancement, and you can forget it. It will save us some hours of work...".

And by and by functionality is increasing, and the script gets worse and worse. And suddenly, sometimes gets the great idea: "...if you just add this feature, we could use it for other problems as well...".

I try to prevent such situations by trying to write every script as good as possible (if possible because of time and the like). I try not to say, it will take me about 30 minutes, but instead I say: 2 hours. So, at first it always takes me more time than necessary at the beginning, but saves me lots of time (and reputation as well) in future.

The (nearly) only throw-away-scripts I write are one-liners or the like (I normally don't save them to a file)...

But nevertheless, I sometimes produce code that I'm not so much proud of, because of many reasons already mentioned in this thread. But I will keep on learning.

Best regards,
perl -le "s==*F=e=>y~\*martinF~stronat~=>s~[^\w]~~g=>chop,print"


In reply to Re: Confessional: why I wrote bad Perl code. by strat
in thread Confessional: why I wrote bad Perl code. by vladb

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.