Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

By the time I picked up Perl, my programming style wasn't nearly as bad as you describe. It wasn't as good as now, and I tended to use globals a little too much, and I tended to think procedurally rather than in terms of context, but I had already come a long way.

This may be because my style had already been improved by using various other languages. From GW-BASIC I learned to use RENUM instead of a lot of extraneous GOTO (though some GOTO is virtually unavoidable in that language, due to lack of nested conditionals). From Pascal I learned even more structure, which revolutionised the way I wrote BASIC. Then I took college courses in assorted other languages, and I'm sure I learned from those too, though I can't point to anything specific (except the data structures and algorithm analysys class). By this time, of course, I was already a prolific commenter, and my comments were starting to have some minimal level of quality. In my spare time I picked up the Inform Designer's Manual, which revolutionised the way I think about objects. Inform was the second language (after BASIC) that I was able to think in. Later the Gnu Emacs Lisp Reference Manual again greatly expanded the way I think about programming, and elisp became the third language I think in. Perl is the fourth, and the best so far, though I have a special fondness for each of these four languages. (The other languages, which I never thought in, but only translated to, I have no special fondness for. Some of them, such as C++, I actively dislike.)

I did write some Perl code I'm not terribly proud of, e.g., the code behind the list of uses for peanut butter (one of my very first projects in Perl), but even that is not nearly as horrific as your description. If you want truly horrible code from me, I'll have to go back to my early years, when I was writing in other languages. I believe I had a word scrambler program in BASIC at one point that was going on a thousand lines and had lots and lots of GOTO statements. At the time, I was proud of it, because it was so much work to write. Now, of course, I'd write it as one line of Perl and play golf with it.

$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/

In reply to Re: Worst thing you ever made with Perl by jonadab
in thread Worst thing you ever made with Perl by Juerd

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others about the Monastery: (5)
    As of 2021-03-01 04:13 GMT
    Find Nodes?
      Voting Booth?

      No recent polls found