Ask HN: Should I publish my research code?
421 pointsI'm looking for advice om whether I should publish my research code? The paper itself is enough to reproduce all the results. However, the implementation can easily take two months of work to get it right.
In my field many scientists tend to not publish the code nor the data. They would mostly write a note that code and data are available upon request.
I can see the pros of publishing the code as it's obviously better for open science and it makes the manuscript more solid and easier for anyone trying to replicate the work.
But on the other hand it's substantially more work to clean and organize the code for publishing, it will increase the surface for nitpicking and criticism (e.g. coding style, etc). Besides, many scientists look at code as a competitive advantage so in this case publishing the code will be removing the competitive advantage.
Comments (353) 192 threads
Show all comments
Showing thread 79 of 192
You should have confidence in the correctness of your code if you are publishing.
If your code is a shitshow, why do you trust it? Decent code is to your own advantage even if no one else ever looks at it.
In the best case, it’s possible to build a community around your code, to wide benefit and your career benefit. I’ve seen this with several peers and students.
As a hiring manager, it’s very nice indeed to read a paper and scan the code of an fresh grad applicant.
My lab’s approach is to put the repo in public and put the hash of the relevant commit in the paper. Then you can keep developing there but readers can be confident they can get the exact code used to justify the claims in the paper.
An exception is if you plan to make a company around your IP. You should estimate how likely this is to happen before defaulting to this.