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
Earlier commentsI should take a couple of hours. The code works? You know how to reproduce what you did, right? It shouldn't be perfect. Shouldn't even pass code review. Should just work.
> many scientists look at code as a competitive advantage so in this case publishing the code will be removing the competitive advantage.
Well depends on the field I guess, but you also want recognition and impact. What is the point of publishing a result no one uses?
Unlikely. Following the algorithm from scratch may produce "similar" results, but not "reproduce", bugs and all. The only thing that can do that is your code.
Plus, typically, when you set out to reproduce a paper from only the algorithmic description, it's typically not until you're 2 or 3 weeks into coding that you realise the original paper made many assumptions in the code that were not explicitly stated in the paper.
> However, the implementation can easily take two months of work to get it right.
An even more important reason why you should release your code.
> In my field many scientists tend to not publish the code nor the data.
A regrettable state of affairs indeed.
> They would mostly write a note that code and data are available upon request.
I have personally come across many cases where this promise could no longer be honoured by the time of the request. Publish the code.
> 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.
It is also increasingly a requirement for funding bodies
But on the other hand it's substantially more work to clean and organize the code for publishing
> Then don't. Release it under the CRAPL, stating as much. It is still better than nothing.
> it will increase the surface for nitpicking and criticism (e.g. coding style, etc).
If you were an entrepreneur hoping to peddle snake oil and not get found out, then I would see your point. But you're a scientist, you're supposed to welcome such criticism and opportunities for improvement. If anything, you might even get collaborations / more publications on the basis of improving on that code.
> Besides, many scientists look at code as a competitive advantage so in this case publishing the code will be removing the competitive advantage.
I would sincerely not feel very comfortable calling such people "scientists".
All comments shown.
Couldn't load more comments. Check your connection and try again.