Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-03-28 12:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found