4 ms·
I think the reason scientific code is spaghetti has more to do with different incentives than time management. you don't need scalable production quality code.
by mathperson 9y ago
I think the reason scientific code is spaghetti has more to do with different incentives than time management. you don't need scalable production quality code. you need a minimal working example of something even its a kluge. correct and ugly and novel will win over optimized and pretty and commented and non-novel...
- neuromantik8086 9y agoI don't know whether or not the incentives or the time management contribute more towards the messiness, but I will nitpick one implicit assumption you're making here, which is that scientific code is "correct". There has been at least one well-publicized incident where scientific code is both messy and very much incorrect. I also think that, while optimization isn't necessarily something that researchers should focus on, pretty code / documentation / comments / systematic testing are elements that researchers really need to emphasize, because these practices ensure that the likelihood that their simulations / analysis pipelines aren't spewing out nonsense is substantially decreased. Furthermore, these practices would make code reviews a lot easier- it's much harder to make sense of your code when every other variable is named "i", "j" or "k" and this seems to be a common practice in some fields at least.
- mathperson 9y agoYou know that is a very good point actually. I have talked with some bioinformaticians who have trouble reproducing others work because the dataset was unavailable or the code was not provided. Personally, all the academic code I've used has been written by EE people or Applied Math people and had nice enough style/documentation/accessibility for me to have minimal issues.