This is something I think about quite a bit - I tend to do things haphazzardly. I learn best when I have an actual problem to solve. I can't just decide I want to learn about 'x' and then learn 'x' eaisly. Once I have purpouse I tend to Jump in head first w/o really knowing where Im heading with the code. I usually look at code Ive written in the past, to see how Ive solved similar problems, or I read snippets of others code - and somehow after reading tons of perl documentation, and re-writing I will wake up at 3am and it all seems so clear. For instance, I was recently porting a perl script which works on AIX to Linux, the original script contained tons of bad code to start with the original author did not use strict; or use warnings; I started there, once I added those and re-wrote this program of about 300 lines, and was not quite satisfied with it, but it worked - I woke up at two am and the words dispatch table popped into my head - I recoded the entire thing in like 70 lines, and it worked beautifully - I really didn't understand dispatch tables, but I remembered reading a node here recently, and knew that was my awnser, I re-read the node and it all just made sense - so to awnser your question, its more of a process for me, I need a goal and things that Ive learned or read about that were just beyond my grasp come into play - I want to say something now about the good code being the child of necessity or something corny like that, but Ill stop here, and leave well enough alone...

Ted
--
"That which we persist in doing becomes easier, not that the task itself has become easier, but that our ability to perform it has improved."
  --Ralph Waldo Emerson

In reply to Re: Does bad code really teach you to write good code? by tcf03
in thread Does bad code really teach you to write good code? by Gekitsuu

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.