Programming that happens in labs is typically rushed and sloppy. The goal is to get the job done right, and, almost as important, done ASAP. The goal is not to generate ultra-readable, conforming code that is full-featured and ready for distribution. This is similar to the “Worse is Better” philosophy of software development (which I’ve also seen called the “Carnegie Mellon” style, to contrast it with the “MIT” style that emphasizes completeness).
It sometimes takes discipline to stay focused and avoid the temptation to add in more features, improve the design, and make more bulletproof, elegant code. Particularly when working on very difficult biology experiments, when the control and reproducibility of programming can be a tremendous comfort and wonderful escape.
Here’s a recent, interesting discussion on the topic entitled “Do it right or do it ASAP?”.
The first priority is always accuracy. The code has to give the right answer. But as long as that’s taken care of, getting to version 1 as fast as possible is typically what I emphasize. Note that this isn’t the same as “Fail fast”, which I think encourages sloppiness. Rather it’s a prioritization of completion of a computation, ahead of the development of a mature piece of software.
What principles do you stick to when coding?