On the 2nd of May 2018, David Hubber, a postdoc at Ludwig-Maximilians-Universität Munich, gave a seminar on Long-term Software Development for Scientists, as part of a series of talks around good practice at the University of Sheffield. David discussed how to structure code efficiently, code module design, decoupling strategies and test-driven development.
I’ve had the pleasure of meeting David previously— we’re both astrophysicists working on simulations of star forming regions. In particular David has a great deal of experience in working with big codes that span tens of thousands of lines. While my own work is of a smaller scale I and I think many researchers are familiar with writing programs that start small and quickly evolve into a huge unmanageable mess.
David discussed the dangers of “the blob” and “spaghetti code”, before going on to cover strategies to avoid them. Some of these strategies were stylistic, he described how keeping consistent with style choices in your code makes it easier to understand for your future self and others, thus making it more maintainable.
He also discussed how comments (while absolutely vital) can also be something of a double edged sword if misused. Excessive comments can…Continue Reading