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

Re: clean up/professionalism

by cat2014 (Monk)
on Feb 13, 2001 at 10:43 UTC ( #58096=note: print w/replies, xml ) Need Help??

in reply to clean up/professionalism

You should check that your code fails gracefully, too. That was a really hard one for me to learn- I wrote code that had all kinds of silly dependecies (servers being kept up by other people's personal cron jobs, report files being available in random places, etc), and then forgot about the scripts. When the script would start randomly failing because something it had depended on changed, it would take me forever to track down the problem. I try to be really paranoid now, and wrap stuff in evals, check return codes from system calls, & write error strings that make sense. It's good to not have to explain to people that you have no clue why your tool started failing over weekend & that you'll have to get back to them in a day or two. Although I guess that if you're leaving, you won't have to deal with that part. (:

It's really hard to make the adjustment from hacking code for your CS homework or your own website to writing code that people depend on to do work, though. I'm always finding new things that I should be doing & becoming embarassed that I hadn't been doing them before. -- cat

Replies are listed 'Best First'.
Re: Re: clean up/professionalism
by malaga (Pilgrim) on Feb 13, 2001 at 10:48 UTC
    thanks cat! i guess i'll start my own checklist, and i'll add your suggestions to it.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://58096]
[Cosmic37]: if ( $line =~ /$mydt/ ) { print $line; }
[Cosmic37]: I try to match successive date times stored in variable $mydt
[Cosmic37]: I guess it is searching for the string "$mydt"
[Corion]: Indeed cool, erix ;)
[Cosmic37]: rather than the value of $mydt which is a date time strong such as 2016-01-01 12:30:56
[Corion]: Cosmic37: No, but maybe $mydt doesn't contain what you think it does, or it contains characters that are special in a regular expression? Try if( $line =~ /\Q$mydt\E/) { ... for a literal match
[Cosmic37]: I mean string grrr
[Corion]: Maybe add an else branch in which you print what the values of $line and $mydt are?
[Cosmic37]: ah thank you I will try
[Cosmic37]: you are right $mydt did not contain what I expected... :-D I will now think :-D

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2017-06-29 17:02 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (673 votes). Check out past polls.