When you write an essay, you don't just "dive in and write". You make a plan, called an outline, figure out what your major themes will be, how they'll prove your thesis, and how they'll link. You design an introduction and a conclusion, and then you put all the pieces together.

Coding is the same. Build an outline. Figure out what the job is. Break that job into smaller concepts. Figure out how those concepts relate, and what the inter-dependancies are. That will tell you something about the data you need to pass between them. Work top-down and bottom up towards the middle, and know what the plan for each section is before you start. Draw block diagrams, and see how each block fits together with the others.

Document your design: both in your code, and outside of it. Six months from now, you'll forget what you were trying to do. Write comments first, then write code that matches what the comments say. Make sure the comments explain what you're trying to do, and not just how. Keep them up to date.

Example.

# Bad comment example # get characters 5-14 of DIALED into $y $y = substr($DIALED,4,10); # Good comment example # Extract the destination phone number from the dialed # digits field. # Skip over the speed dial digits. $dest_phone = substr($DIALED,4,10);
Sure, by all means, do small scale, proof of concept experiments, try stuff, and learn what you can "by doing". But don't forget to practice designing your code: it's an important part of the craft of programming..

Finish reading the chapter on subroutines! Subroutines are arguably the most important idea in programming. Learning to break a big problem into sub-problems, and carefully solve each piece one bit at a time is an imporant life skill; and not just when it comes to programming.

Good luck, and keep learning! Keep asking questions; of yourself, and of others. The most important part of the learning process is to keep learning. :-)

--
Ytreq Q. Uiop


In reply to Make a plan by Anonymous Monk
in thread How to start. || Ramblings of a confused mind. by jkva

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.