in reply to Never guess at code!

I guess it all depends on your programming mentality. I've been at it for a while now (although not all Perl), and I have never been able to stand writing more than a few lines of code without checking that it works.

This is probably a personality thing - I just get really depressed if I can't see the results of my code running every half hour or so. I have this dread of writing some elaborate routine that takes ages to implement, and then discovering that I can't do it like that and having to scrap all that work. I have to say since I came to Perl that's happened a lot less :)

I also can't imagine coding without half a dozen help windows open showing the docs for the modules I'm using in my program. I do know people who like to do the whole program in one shot, then go back through and pick up the problems later. Personally, I can't stand debugging, so I do whatever I can to make sure I never have to do a huge debug session. I dread trawling through thousands of lines of code to find the bug.

Also, similar to the tip mentioned above, I usually have a window open to a program called test.pl, wherein I test anything that I'm not totally sure of. A lot of my program gets written in there, and then copied in to the body of the main bit when I'm totally sure it workd.

____________________
Jeremy
I didn't believe in evil until I dated it.

Replies are listed 'Best First'.
Re: Re:(Jepri) Never guess at code!
by nysus (Parson) on Jul 03, 2001 at 22:35 UTC
    jepri, thanks I found your post very enligtening. I've never seen anyone other than myself program so I'm very interested in hearing how you "debug while you code". I guess I do a little bit of both. Sometimes I just charge on and let the compiler and warnings catch my errors (hopefully), other times I'll write just a couple of lines and execute it. Obviously, it's the times when I rely on the compiler and Perl warnings that I get nailed because they can't catch errors in logic or my misunderstanding of the Perl interpreter works.

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar Abbot Bishop";
    $nysus = $PM . $MCF;
    Click here if you love Perl Monks