Words of Advice

When you’re developing software, the new version is not always the best. The tests that are run are always hugely insufficient, and if you keep up to date you’re just left with not working software most of the time. It’s better to have your own set of tests, and keep 2 versions, one that’s really tested for production, and another that you keep for development.

Second, when you have a bunch of scripts it’s a pain to maintain slightly different versions for each machine you work on. Here’s where setting your own variables in your bashrc comes in handy. I put a whereami variable in my bashrc, so it’s alwasy in the environment, and it will contain a word that identifies what computer I’m working on. Then in a perl script for instance I can say $location=$ENV{‘WHEREAMI’}, then have if statements to set the directory paths that I need for that machine.

Finally it saves you time in the long run to build in output file checking in your scripts, i.e. before you ask the computer to do something make sure the output file doesn’t exist. This allows you to have one script to run on every file of a certain type, and just to run it if everything completes the first time great. If there’s a bug that effected only a subset or you for some reason had to kill the jobs before they all finished, all you have to do is submit again, and it will only run the jobs that didn’t finish. Works best if the files aren’t put in their final location until complete, i.e. output to an output.txt.temp file, then after output.txt.temp is done move output.txt.temp to output.txt, the move command will never crash, that way you can just delete all the .temp files and run again.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: