Battling Bugs in Scientific Coding


Of late, I have been reading some scientific articles and opinion pieces regarding one of the biggest fears that I, and I am sure other scientists in the field too, face often. The fear that there may be bugs left in the trail of code somewhere that we depend upon so dearly to analyse and interpret datasets, making scientific judgements and conclusions. Here is a recent article in Nature which should force us all to re-think and re-evaluate our coding practices.

In my view, and I tell this to my students also, scientists should try to adhere to the following basic guidelines when writing their code:

– Mention the name of the coder and date along with any versioning

– If the code is based on or derived from some other code, mention that too

– Use extensive commenting, for your own and others’ sake

– Check and double-check your code

Recently, there has been a lot of advocacy on making the code public and sharing it in public; however, I do think only well-documented code should be published, because a non-documented or badly-documented code can actually cause more confusion. Here is an old article in Nature which argues to the contrary. Let us know your coding practices and recommendations in the comments.

Note: This post is inspired from this fascinating article in Nature, which I encourage you all to read: Computational science: …Error

This entry was posted in Uncategorized and tagged , on by .

About WQ

I received my PhD (2013) in Remote Sensing, Earth and Space Science at the Dept. of Aerospace Engineering Sciences, University of Colorado, Boulder, USA, under a Fulbright fellowship. Currently, I'm an Assistant Professor in the Dept. of Space Science at Institute of Space Technology (IST), Islamabad, Pakistan, where I have been a founding member of the Geospatial Research & Education Lab (GREL). My general expertise is in Remote Sensing where I have worked with various remote sensing datasets through my career, while for my PhD thesis I specifically worked on Remote Sensing using SAR (Synthetic Aperture Radar) and Oceanography, working extensively on development of techniques to measure ocean surface currents from space-borne SAR intensity images and interferometric data. My research interests are: Remote sensing, Synthetic Aperture Radar (SAR) imagery and interferometric data processing & analysis, Visible/Infrared/High-resolution satellite image processing & analysis, Oceanography, Earth system study and modelling, LIDAR data processing and analysis, Scientific programming. I am a reviewer for IEEE Transactions on Geoscience & Remote Sensing, Forest Ecosystems, GIScience & Remote Sensing, Journal of African Earth Sciences, and Italian Journal of Agronomy. I am an alumnus of Pakistan National Physics Talent Contest (NPTC), an alumnus of the Lindau Nobel Laureate Meetings, a Fulbright alumnus, and the Pakistan National Point of Contact for Space Generation Advisory Council (SGAC). I was an invited speaker at the TEDxIslamabad event held in Nov., 2014. I've served as mentor in the NASA International Space App Challenge Islamabad events in April 2015 and April 2016.

One thought on “Battling Bugs in Scientific Coding

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s