Very similar to not knowing any better:

Because I am a crappy programmer
If a good programmer thinks things through carefully before starting, then I'm not a good programmer. If a good programmer carefully reviews CPAN for existing implementations before beginning anything new, then I'm really not a good programmer. And if a good programmer implements just the features needed at a given time... well, maybe I should pick another profession.

But that's just a small taste of how bad I am. I'll switch to a slower algorithm to avoid using a temporary variable. I abbreviate variable names to make things fit on one line. I do things in strange ways just because I heard about them or thought "I wonder if you could...", and I use the result in production scripts. I parse HTML and XML with regular expressions. Often. I write code that I know won't work when given filenames with spaces. I'll sometimes keep using code because I'm proud of how little time it took me to write the initial (almost) working version. I'll use C instead of C++ because C compiles faster (so I can get back to gdb faster). I'll use Inline::C for something that would be easier to write as straight C, just because I feel like using perl. I'll spend two hours optimizing code that I plan to run once, where the initial version would have finished in half an hour. I'll rewrite efficient, elegant code because I couldn't understand the algorithm in the original, and end up with a sloppier version of the same algorithm. And then I'll use my inferior version when the time comes to plug it into the rest of the system.


In reply to Re: Confessional: why I wrote bad Perl code. by sfink
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.