Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

(dws)Re: How to write long programs?

by dws (Chancellor)
on Mar 08, 2001 at 00:19 UTC ( #62817=note: print w/ replies, xml ) Need Help??


in reply to How to write long programms?

... but if i look a the code 2 days after i wrote it, i don't understand it.

There's some very good advice above, with one caveat: we're not inside of your head, so we can only guess at why it is that you're having difficulties understanding your own code.

Solving this is going to require some introspection on your part. You're going to need to take a step that may be difficult: Each time you find yourself not understanding your code, step back for a moment and try to get more specific about what you're not understanding. Are you lost in the the structure? Are you lost trying to figure out what your regular expressions are doing? Are you lost trying to tell where things happen in your code? Are you lost trying to figure out why things happen in your code?

Once you've labeled a particular problem, a good step is to consider what you could have done up front (2 days earlier) to avoid that problem. This may using clearer variable names, or whitespace around certain syntactic elements, or more (or less) commentary. Without seeing your code through your eyes, it's hard for us to guess what you'll need to do.

The next step is an important one: Write your observations down. Keep a log. With a written record, you're more liable to see repeated patterns that you miss in day-to-day coding and debugging. And the mere act of writing problems down can be a creative stimulation.

You may find that you only need the log for a while. But if you start working on larger projects you'll run into a different class of problems, and you might want to start keeping a log again. A 250 line CGI script might seem large now, but one day you might find yourself working inside of a 250,000 line system.


Comment on (dws)Re: How to write long programs?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://62817]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2014-12-18 12:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (51 votes), past polls