Lurker News
I'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 comments
npteljes#
OP, you shouldn't worry about the state of your code. The could be criticism, but I don't think there's anything that's public and not criticized. A horrible thing that's open source is much better than something that's not. The only real thing to consider here is the type of the license, and weighing the competitive advantage you're talking about. With the license, sites like this[0] can help.

[0] https://choosealicense.com/

sampo#
(A) Publish your code as is, so the code is the actual code used in the paper.

> But on the other hand it's substantially more work to clean and organize the code for publishing
(B) Don't spend time cleaning code for publishing. Spend your time writing more papers.
> it will increase the surface for nitpicking and criticism (e.g. coding style, etc).
(C) Don't worry about this.
> Besides, many scientists look at code as a competitive advantage so in this case publishing the code will be removing the competitive advantage.
(D) If you do B, if will also reduce your worries about this. I am half joking.

lofatdairy#
Personally, as someone who's had to dig through academic code in the field of bioinformatics, I do appreciate code being attached to the paper, regardless of the paper's level of detail or the code's quality (or lack thereof). I don't think many researchers expect high quality code unless you're releasing a library explicitly for general use and expect contributors. That said, a brief README with at least instructions to execute is a rare but welcome addition in my personal opinion.
sfifs#
Please publish. Even if you are filing some patents or working on some other commercial licensing, you could publish under a source available licenses. Just yesterday I saw in the 3D printing Reddit some academics developed an interesting approach to segment large panel sections and posted a paper. A number of people are interested to try it but no source code seems to be published - so I just moved on as I'd have to take the trouble to reimplement the paper even to just try it .

Load more comments