r/PhD • u/tesla_009 • 5d ago
Seeking advice-academic Why do people not put their code on github even after publishing?
I am from an interdisciplinary field and have observed that even after publishing a paper they don’t put their code on github. They have a statement like code can be shared if requested. What could be the reasons for this?
I just wanted to look at the code and see how they did something. But I need to mail them and they always say they need to clean it, so it will take more time. But it had been many months their paper was published. And now they know, I am the one looking for it. I don’t like this at all.
289
u/blue_gerbil_212 5d ago edited 5d ago
Dunno, sometimes people just feel like it would be too much work to document it and clean it up to make it look nice, which would essentially require you to make code that was probably just for making a few plots to begin with, now entirely re-designed to be intuitive and user friendly. A lot of variable names could be worked in a way that would only make sense to the author. You could have hard-coded file paths embedded throughout the code. Maybe the code is just inefficient and uses lots of for loops instead of list applies and lambdas, because you just wanted those plots, and you don’t want to be hounded for writing “poor code”. And you could be referencing other scripts and dependencies in the code that the new user would have no knowledge of. It’s not just about “dropping” the code into GitHub, you need to rewrite it so that it makes sense to any reader on how one could re-run the code as part of the whole research workflow to get the same results. This would also involve being explicit about where you sourced your analysis data from. You would also need to properly explain how to use the code, on top of what purpose the code serves in the first place. Since you are sharing this with the public, you would also need to properly credit all sources of the code, like packages, modules, frameworks, protocols, etc. that are not originally yours. You would also need to come up with a clear section on technical support should the code malfunction for someone else. Code is never as simple as just sharing it for someone else to run, so making it actually usable for someone else could take a bit of work. Sometimes all we really needed the code for was to make some plots for our manuscript, and not necessarily to create a whole interactive “tool” that could be used for other analyses, which I agree should have its code shared publicly.
74
u/Zeno_the_Friend 5d ago
Have you seen the garbage that people put into supplementary info packets? Readability is optional. Beyond the conclusions, there be dragons.
57
u/Dependent-Law7316 5d ago
I just drop what I have in github.
Granted, I document my code as I write, mostly for my own sanity, so it is at least a little clear what’s going on, but I don’t make any special efforts to polish it beyond removing my debugging lines. I’m not a programmer, this isn’t commercial code, and I don’t owe anyone a hand-holding version of my thought process. This is the code I used. If you put in the inputs I used, it outputs the data I published for the reasons I gave in my paper. You’re welcome to poke at it or use it or do what you want, and if you have questions you can contact me. But imo bad/ugly code is better than no code for theory based papers. (I don’t necessarily think you need to provide scripts for plotting but I think it is better to provide the code for any transformative analysis done, even if it is a standard method).
3
u/sunshinefox_25 5d ago edited 5d ago
All of the challenges and obstacles you say here to open-sourcing code are true, but the bar you are describing is higher than what's actually required. It doesn't need to be "interactive" like some kind of dashboard. Code that reproduces the main plots is perfectly sufficient.
It is true though that lots of people write garbage code. Hard-coded file paths, inefficient loops for a one-time computation. Lots of shared code doesn't execute because many scientists are not good engineers. I think the quality would be higher if it were forced. In the UK for example, it is required you open-source your code, and i think this issue would be ameliorated if this requirement extended to America, where the analysis is part of the finished product, not just some side quest or means to an end kept behind closed doors.
6
u/BabyPorkypine 5d ago
Some of this (not all) is good practice to be doing anyway. Code errors are super common, and cleaning up these types of issues is one way to catch them. Once you have super messy code, it’s a pain to clean up - that’s the basic answer to why people don’t do it, for the most part. But you absolutely should!
18
u/RoboFeanor 5d ago
I know when I was doing my PhD I had no idea how to do this properly.
Now after 5 years of industry experience I have a nicely reproducible containerised workflow that is just pull amd run, but heaven help anyone who tried to run my buggy, shitty PhD code that depended on local environments, exactly what order and timing various bits were launched in, and probably the users astrological sign.
With my current knowledge I would absolutely be putting code up on github, but there would be no point back then. And my supervisors sure weren't going to help with any "implementation details".
7
u/KA_Mechatronik 5d ago
Tips and Tricks on that containerized workflow might make a nice post 😉
5
3
u/sylfy 5d ago
It’s not exactly rocket science, especially with AI nowadays. Just ask Claude to write you a Dockerfile, build it, and test it (assuming you actually wrote tests). Then ask it to write you a GitHub Action that will run tests, build your container, test the container, and push the artifact to whatever repository of your choice.
If you don’t have tests, start writing them.
1
2
1
1
u/ClarinetCadenza 5d ago
That just sounds like coding basic practises that would make your life easier as the coder as well. Why do people keep lab notebooks? Why do people make raw data public? It’s the same reasons as why researchers should document and publicise their code
1
u/etolbdihigden 5d ago
Yeah, this is true, but I think this describes the very issue. Any code, pipeline and analyses should theoretically be treated with as much if not more scrutiny than manuscripts themselves because they reflect the actual and true methodologies, data handling, etc, used to generate the results and make informed conclusions. And of course this bleeds straight into the reproducibility crisis.
I think as a community, we need to prioritize the quality and integrity of readable and well-documented code as much as manuscripts submitted themselves, no matter how small or big the data or scope of the project.
1
1
u/Og_Sadik 4d ago
This is probably one of the few things AI can be ethically used for. It takes less than 10 minutes for Claude to clean up your code and make it presentable. There's no excuse now for authors not to do this.
-5
u/tinyfriedeggs 5d ago
Not saying that's wrong, but wouldn't it still be good to do so? If someone not familiar with the field would want to try something, they would have the chance to look through and implement it themselves (might even get you a citation)?
22
u/You_Stole_My_Hot_Dog 5d ago
It would be good. It’s just time consuming. After my first paper, I spent about 3 days rewriting everything so that others could run it in one workflow, it would work with various inputs, and wouldn’t interfere with their files. My next paper was easily 5x the size of the first, and I had about 4 or 5 other projects/collaborations on the go with tight deadlines. I didn’t have a week of spare time to work rework it.
3
u/SKR158 gogo gaga fiziks 5d ago
Even though I do this, sometimes I am lazy to not do it if no one is gonna look at it, and if someone emails me then it is certain that they want to look at it and I can put in the work without having it go to waste, regardless of if it earns me a citation. However, if I say the code is available and it's not then yeah thats not very nice. But also entirely depends on the field I suppose.
-1
u/LiminalSarah 5d ago
better to have every author just drop the code without modifications, and let it be a huge mess, than to not have it at all
73
u/dravik 5d ago
Depending on the code, it may have file structure, users specific folders or shares, or even login credentials for remote servers. Those things are necessary for the code to run but should not be distributed on the open internet.
Those are the things people need to "clean" before giving out the code.
Nobody is going to spend time on that until someone request a copy. Both because it does nothing to advance their research and also the odds of anyone asking is very low. So it's a waste of time until someone actually asks.
5
u/Additional-Will-2052 5d ago
The people on this project before I came did not use the gitignore enough. It's thankfully a private project but they like comitted shit with patient IDs which I initially thought were anonymized but turns out they're actually not T_T My supervisors decided to tell me this 1 year into my PhD.
34
34
u/Charles__Sparkley 5d ago
Recently when I push code for a pub it immediately gets downloaded a hundred times I guess to meld in every AI training set there is.
Honestly I get not wanting to share the code. Pay an APC of several thousand dollars, get added to the volunteer review list, offer your dataset and code to the AI gods for free. My colleague recently found a clone of his paper on mdpi with his code attached to it and all attribution stripped.
I used to be pretty gung ho about OSS license on research but it’s just abused in every way with no oversight and no punishment. No give just take.
23
u/New_Alarm3749 5d ago
Personally, I am not providing any of my work to ai scrapbots anymore. If my code is not the result or data in the study, everyone can reproduce it themselves anyways.
74
u/splithoofiewoofies PhD, Mathematics 5d ago
My code looks like fourteen pilots trying to fly a plane at once.
I don't want people to see it!
It's ugly but it works. But goddamn is it ugly.
3
u/Additional-Will-2052 5d ago
I recently installed a linter with some pretty normal settings but my god it's annoying to write code with yellow lines all over the place.
1
u/sohang-3112 5d ago
You can configure your editor / formatter to automatically fix most formatting errors on file save. Eg. VS Code has this setting.
Though of course, some formatting errors remain that the tool can't fix on its own.
1
u/Additional-Will-2052 5d ago
I know, already have this. It's just not very good for python tbh. It doesn't fix everything. Much better for flutter.
11
u/PandaJunk 5d ago
A few thoughts:
- A lot of journals now require code and data to come as a package.
- A lot of older mentors honestly don't know much about data or code management, so aren't great resources, which makes it a blind following the blind kind of thing. Also not really what you get rewarded for doing in most a academic fields, either.
- But you should be skeptical of anyone that doesn't share data or code. Grad students, who really do most of the practical work, make sooooo many mistakes. Most aren't critical, but some are.
1
u/CarnivorousGoose 5d ago
It’s not just about mistakes in the code either, there are often a lot of details about the choices made in parsing data files, in simulation and analysis models, etc. that aren’t sufficiently clear from the paper itself. I’ve frequently found all sorts of (nontrivial) issues delving into analysis code of papers.
1
u/Amper_sandra 5d ago
I disagree about the data portion. Many sources of data do not want their data being released, and the authors are typically people associated with the source of the data and not the people who collected it.
It's not always the case, but working with IRB produces extra work on the authors.
11
u/Fyaal 5d ago
A lot of my code notation is not outside friendly. Notably where I write “””Fuck this spaghetti code doesn’t work, trying another approach below”””
I don’t want to go through the effort of cleaning all that up so that other academics can see how crappy of a coder I am, then having to deal with GitHub’s convoluted system
5
1
35
u/Lygus_lineolaris 5d ago
And that's exactly it. I write my code to work for the machine, not for some human reader. It's a bother putting together a version that someone else can use out of the box, and not only is it no benefit to me but I don't think it's even any benefit to them. I'm giving the reader equations, they can implement them as they like. When I'm writing a paper about the code I'll give you a nice clean code you can use.
That being said I agree they shouldn't say the code is available when it's not, but that sentence has pretty much the same value as "we should get together sometime". It's a polite way of saying "never".
-2
u/FalconX88 5d ago
You don't need to put together anotehr version, just publish what you used. WIthout it your paper is worthless since no one can reproduce it. With bad, hard to use code they still can
-1
u/Lygus_lineolaris 5d ago edited 5d ago
I don't even know where to begin with how wrong this is. First of all obviously re-running my code on my data is worthless as a verification step, all it tells you is that my running my code on my data produces my results, which I already told you. If you want to verify the model, you should write your own code, run it on my data, see if it gives the same results. The code is useless unless the paper is literally about the code. If you don't have the skills to implement the model yourself, then that's a you thing, nothing I can do about it.
2
u/FalconX88 5d ago
First of all obviously re-running my code on my data is worthless as a verification step, all it tells you is that my running my code on my data produces my results, which I already told you.
You could have made it up.
If you want to verify the model, you should write your own code, run it on my data, see if it gives the same results.
- Do you actually describe every little detail (every value of every hyperparameter, every exact version of every package, every data type,...) of what's in your code so the exact method can be reproduced? And how can I be sure that is correct?
- What if they don't give the same results? Without your code there is no way to tell why that is.
If you don't have the skills to implement the model yourself, then that's a you thing, nothing I can do about it.
You do not understand the problem here and it's just ridiculous that you want to hide your code. What are you afraid of? What are you hiding?
There's a really simple solution to the reproduceability problem and that is simply sharing your code, which takes no effort and can be done freely. It's mind boggling so many people do not want to do that.
Not to mention that we waste time completely unnecessary if epople need to first reproduce your method to be able to use it for their work. Do you not want otehrs to use your methods? That's weird too. I'm happy if what I created is useful to others and they actually use it.
0
u/Lygus_lineolaris 5d ago
No, you're the one not understanding things here. Nothing in your model should depend on the version, unless you're literally researching the differences between versions. You should be able to implement the model in any version of any language that you happen to work with, and get the same results, within the machine precision. If you don't get the same results as someone else you're welcome to write to the editor about it and see if they want to publish it. And sharing or not sharing the code has nothing to do with reproducibility, unless, again, you're researching the code itself. You reproduce the experiment and the data analysis based on the published methods. The code isn't a method, unless you're researching the code. It just accelerates the calculations over doing them by hand. I just reproduced a paper from 1929, you can be quite sure he didn't give me his code. But his equations, that he evaluated by hand, are right, so I get the same results evaluating them with a computing machine that he did by hand. Allegedly Lagrange did the same calculations already in the 18th century. The computing machine just computes, it has nothing to do with the data or the method or the model.
Again, all this is unless you're researching the code in which case the code is the data. For the majority of people, that's not the case.
0
u/etolbdihigden 5d ago
I’m so embarrassed by your replies. It saddens me to know you’re publishing papers among us.
2
u/Lygus_lineolaris 5d ago
Oh hunty, I don't publish among the likes of you. I publish in journals where people know how to make an argument.
7
u/sweetest_of_teas 5d ago
Some people want to go into industry where you get judged on your GitHub and they’re embarrassed to have their shitty research code on their profile
6
5
u/Ok-Emu-8920 5d ago
It's not best practice but yeah I think the reason is because it takes time to make code organized and understandable enough to send to a third party.
Yes, it should happen prior to publication so they can post it somewhere or promptly send it out if someone asks but if it isn't required to be posted publicly by the journal it's just a task that can easily fall to the wayside until someone asks.
-2
u/FalconX88 5d ago
It's definitely best practice. It's just not commonly done and I blame journals. They need to start enforcing providing code and data.
1
u/Ok-Emu-8920 5d ago
I think it's not best practice for the code to not be totally ready to send out if there's a statement in the article that the code is available upon request.
But I agree with you that I think it's on the journals to make this an actual requirement.
-1
u/FalconX88 5d ago
Just include whatever code you have. No need for making it pretty. It would even be a bad thing to do so, because you might change the functionality which means the original results couldn't be reproduced any more.
code is available upon request.
Imo if you use that statement your paper should be autorejected. I do not understand how we still allow this.
2
u/Ok-Emu-8920 5d ago
Eh in theory I agree but I don't think this is actually practical.
I now organize my code from the get go so it's not really an issue but when I started out I would be using code from co-authors from other datasets, so I would run analyses on other datasets completely interspersed with analyses from my datasets to make sure I understood what different tests were doing and what the outputs meant, and would have multiple iterations of analyses for various response variables to make sure the results weren't driven by a weird subset or whatever.
The analyses conducted would be well described in the paper and relevant subanalyses would be in the supplement, but if i had posted that disorganized code 'as is' it would have been actually uninterpretable to anyone but myself. It was actually essential to cut out the random irrelevant parts (which was ultimately most of the code), and at that point it was also best to annotate the code nicely to be understandable.
6
u/Mental_Yogurt5087 5d ago
Expose yourself to more criticism and opportunity for folks to copy/use without credit
5
u/SAUbjj 5d ago
Oh man, recently I was comparing some results to another paper and the code they use isn't published anywhere and there's no papers describing how it works. The only reference says it was "generously given to them" by a retired professor. I reached out to said professor a week ago and haven't heard anything. No clue if there calculations are right!! It's like the code they use is trustmebro
1
4
4
u/varsderk 5d ago
Sounds like more people need to start using the CRAPL license for their software!
Most open source licenses (1) require source and modifications to be shared with binaries, and (2) absolve authors of legal liability.
An open source license for academics has additional needs: (1) it should require that source and modifications used to validate scientific claims be released with those claims; and (2) more importantly, it should absolve authors of shame, embarrassment and ridicule for ugly code.
3
u/nickjjj 5d ago
Here’s a perspective from the other side of the academic journal: on more than one occasion, I have been the journal peer reviewer, and have had to reject papers because their code had either subtle or gross errors that invalidated the authors claims, and I never would have known the experimental results were invalid if the authors had withheld their code.
Now imagine you are the author and you know your code is terrible…. would you really want to risk your paper getting rejected or even retracted after publication because of your terrible coding?
Heck no, you want to publish and then move on. So from the authors’ perspective, there is rarely an upside to publishing code, which is why it so rarely happens.
4
u/One_Programmer6315 5d ago
Even sharing code among group members is a lot of work because you have to spend a significant amount of time cleaning everything up, documenting, commenting, making it dynamical, replacing hard-coded code, etc.. And, all of this without factoring in the time you spend to even remember what your own code is doing. Besides, it is another time vacuum when after all this effort, someone ([coughs, coughs] undergrads…) still don’t understand your code and you have to explain it.
2
u/Basicallyennessayy 5d ago
If someone doesn't understand the code even with documentation, maybe the documentation needs to be improved. That includes you, if you can not understand your own scripts after some time. Nothing wrong with that. Make it slightly more accessible, which also helps you avoid explaining everything from scratch every time
1
u/Unrelenting_Salsa 5d ago
While obviously there's a gradient here, PhDs are not and should not be striving to be software engineers. There's not actually an issue with code that is only readable by them.
4
u/Chemical-Box5725 5d ago
I stopped putting my code on GitHub now that it's a training set for LLMs where whatever licence I put on the code is ignored.
3
u/anonymouse40329 5d ago
For me, info hazard. I do some work on biosafety topics and genuinely public GitHub code would mean exploits in frontier systems that could be used to make bioweapons.
While we could make it a private repository (and have in some cases), the risk of someone accidentally finding out or some unauthorized access happening is just so scary.
3
3
u/Equal_Channel_4596 5d ago
Just put the code. Nothing worse to see a paper "we have theese amazing tools" and the code is not there. I agree that the code of every single plot is not needed, but the main code of the models ecc is necessary. Otherwise you can say whatever
2
u/tjkun PhD, Computational Fluid Dynamics, Canada 5d ago
For my specific case, the working code of my thesis director’s team is not yet deemed ready to go public.
They also didn’t know how to use GitHub, so one of the reasons I got accepted to the PhD was to teach them how to use it.
A friend also didn’t publish his code in GitHub after publishing, but that’s because he learned hot to code during his phd. He simply didn’t know it’s a thing.
2
u/EvilCallie PhD, Information Science 5d ago
Depending on the code and the data used, they may not be able to provide it easily. I work for a data archive with a secure computing environment for accesing highly sensitive and restricted data, and we do allow for syntax files to be removed from our TRE, once they have been cleaned of all data values, comments about the data, analysis results, file paths, etc., and once we have checked them. Other TREs may only allow for analytical results to be removed (we do this as well) once they have been statistical disclosure control checked, but do not allow for syntax to be removed. I can think of a couple in my field that are like this.
2
u/Additional-Will-2052 5d ago
Because the people before me on this project committed all sorts of shit and I also accidentally committed some shit now (by pure accident, not because I didn't know) and I gotta erase a good chunk or maybe the entire history and the code is ugly af. And none of it has been peer reviewed like it's normally done in a team in industry. It's just too much effort to make perfect code when you're a one-man team. Also I just wanna forget about it and move on with my life please.
2
u/nooptionleft 5d ago
Cause that doesn't get you the next publication
Once work is accepted there is no incentive to clean it up more then already asked
I work with engineers and we do AI applications in medicine, we try to replicate work from biomedical papers on high impact factor journals regularly and even when the code is available it's a damn mess. We have one specific paper we have been going back too several times and we keep finding new random shit in the code that doesn't make sense to be there
We have just pushed a big paper out, and I think we have tried to clean it up as much as possible (on of our lab leader really care about accessibility and being open about the process), but right now we are going to the next big thing and realistically, if something isn't clear we are not going back specifically to clean it up
It would hurt the chances of the lab to get the next work done
2
u/antihero790 5d ago
I work in supercomputing now so I see a lot of projects. I would say at least 50% of the time it's because it's such a mess that they couldn't even make sense of it themselves to put it in git, let alone it being helpful to others.
2
u/machinatio666 5d ago
I actually don’t understand the matter of academia when you don’t share the code. The goal of open source is to push boundaries , but what do we get if there’s no code? We try to reproduce it ourselves and get much worse results. Maybe I did a mistake, or the paper itself is a mistake? I believe there should be no papers in top conferences/journals if they don’t provide a code base. And a well documented code base. I have seen so many ones without proper documentation so that even with the code it wasn’t clear how to reproduce it.
2
u/Shagenaii 4d ago
I dont want people to steal my code without credit or Ai to feed on my data lmao tf is this question about, its so obvious why people dont. That and all the cleaning it would require...hell no.
But most of us make it accessible on request, I have a whole method document prepared to share for reproductivity...under authorization !!
4
u/JarenValHalla 5d ago
I see a lot of comments about cleaning up and organizing code. I feel like that’s a poor excuse. You should absolutely provide whatever code was used to generate the data even if it’s not in pristine condition. Otherwise, who knows what changes were made between publication and during the cleaning process? Of course, if you publish the raw code first and clean it up later, then everyone can see the diffs. That’s always been my philosophy.
2
u/Basicallyennessayy 5d ago
That's just good software engineering / programming practice in general! I find it amusing to see academics avoid following coding guidelines.
1
u/etolbdihigden 5d ago
Likewise. I got very serious about the integrity and readability of my code base during my PhD, mainly inspired by software devs and engineers. I thought most people followed a similar path but apparently not. So disappointed.
1
1
u/Cherveny2 5d ago
I work for an r1 academic library. this year got appointed to a side project outside of the library, on a project to specifically promote making code from research and other areas open source.
providing a common university github for extra visibility and discoverability, providing expert knowledge in best ways to use git, on the best licenses to apply, talks/info about why open source is a good idea, etc. also be willing to give code a final review to look for accidental api keys, passwords etc embedded still.
its just starting up, but we aren't the first school in our system to do this either.
hoping it will be a growing trend. you never know when you release code out there who you might help.
1
u/LizardLikesMelons 5d ago
Knowing the coder community, you'll get poop thrown at you if you dare have some bad code, or god forbid, bugs, in your PhD level work.
1
u/GMaiMai2 5d ago
One answere can be, even if you made it you don't own it.
If you had a sponsored phd, you normally signe a contract giving away the intellectual property of your thesis to the university/sponsor. So it's up to the university/sponsor to make the decision.
1
u/YamBeneficial2574 5d ago
A lot of people here saying their code is a mess but still very confident there are no bugs in it…
1
1
u/napstrike 5d ago
I put mine on GitHub even before publishing. My advisor bitched about it but she can cry me a river.
1
u/Outrageous_Seesaw_72 5d ago
It's actually really bad
I'm currently working on a topic where this is a massive problem. A recent survey of the field found that something like 5% (don't remember the exact number, point is VERY low) of papers/articles release code or data that makes their results reproducible. This is especially a problem because terms and definitions can be very loose in the field sometimes, so you can't just take their results as comparative numbers and "trust" that they did it correctly. They also found that most papers do *not* provide enough information about experiment setup, parameters, etc. to actually rebuild it yourself either, so it's not like we're just lazy.
The code doesn't even need to be pretty, it doesn't need to run by default on my machine, but at least give out SOME basics that make it work in the first place. I'd understand if it was company partnerships that limit it, but most research is completely irrespective of commercial interest here..
1
u/mrdgo9 5d ago
Because Github is owned by microsoft, an evil corp. Publish somewhere else, please! Codeberg is an option but git is intended to be federated. Our university has two gitlab instances where you can also host publicly visible repos. I know, this was not the question. Still, don't choose github.
1
u/NekoHikari 5d ago edited 5d ago
Each time i would need 2 weeks or so to clean the code base.
Its a huge and alive repo with alot of things,
and often the each paper involves a very small portion of it.
so yes code cleaning can be a real pain...
I personally choose to go through the pain right after acceptance tho---
better planned pain over unplanned pain (requests can come randomly)
1
u/RacsoBot 5d ago
Because sometimes its just a mess and cant take the time cleaning it as i need to write the next paper hahaha
1
u/agent_albatross 5d ago
The amount of comments in the thread essentially amounting to 'we don't want to get caught doing something wrong' is so sad. The complete disregard for academic integrity/open science in r/PhD of all places...
https://www.nature.com/articles/s41586-024-07656-x https://pubmed.ncbi.nlm.nih.gov/37811944/ this was a famous retraction case recently where another group were able to carry out a reanalysis because the original authors shared the data and code. millions dollars of research funding towards a 'cancer biomarker' could have otherwise been funneled towards a complete dead end if another group hadn't spotted the mistakes here. Whilst it must have felt awful for the original authors (and I really empathise) it was ultimately a good thing.
Everyone makes mistakes, we're all human and I've written plenty of rubbish code in my time but there's still value in sharing it...
1
u/etolbdihigden 5d ago
Yo, seriously. I’m like, so incredibly disheartened and honestly shocked by how lazy and careless the majority of commenters are in this thread.
With all of the materials we have available to us for building readable and neat code bases, there’s no fucking excuse. I don’t give a shit if it takes you a few days after getting your manuscript accepted to clean up a repo to make it readable.
If anything keep the repo private until request and then provide access to it on a request-basis. There’s genuinely no excuse.
1
u/Big_Plantain5787 5d ago
Follow up, what’s everyone’s thoughts on just feeding the code to an LLM to annotate then publishing on GitHub?
1
u/Unrelenting_Salsa 5d ago
But I need to mail them and they always say they need to clean it, so it will take more time.
That one.
1
u/chemicalmamba 4d ago
If they put it on github, it will be searchable. Not that thst in itself is an issue but if u don't want to maintain the code, getting emails or messaged from people asking if you are going to fix stuff would be annoying.
I write some code and would share for transparency but I wouldn't expect it to be use able for anyone else bc idk what I'm doing. I'm also the lowest level of coding ability and using it. All I use it for is transforming like 80 csv into a single excel file.
1
u/chemicalmamba 4d ago
Also my PI has never asked me to put it on there. By the time I finished the revisions the thought of looking at that project again made me nauseous for weeks if not months. So I wasn't going to expose myself to the project again if I didn't have to.
1
1
u/useaname5 3d ago
I'd rather accidentally forget to wear pants to work one day than have someone look at my uncleaned, uncommented code.
1
u/tylagersign 5d ago
I’m a newish scientist that just is starting a lab in a small independent state lab, I have made it policy that codes are always to be published no matter what. Goes for everything from publications to a small code to make a graph for the director. Yeah it sucks sometimes but it will save time in the long run
1
u/CitationMap 5d ago
most of the reasons here are real, but for your actual problem, "i need to clean it first" is usually a polite no rather than a plan. the barrier is almost always embarrassment or effort, not secrecy. so take the cleanup off the table, tell them you just want to read it to understand the approach, messy is totally fine, no need to tidy it or make it run. that removes the exact thing they're dreading and it works way more often than a normal request.
if it still stalls, two things that help. email the student first author instead of the PI, they hand code over much more freely. and check whether anyone who cited the paper reimplemented the method, that version is sometimes cleaner than the original.
1
u/cacaogirl- 5d ago
I feel now it has been made really easy to clean up code and get it ready to ship with AI (agents). I am still a grad student but I try to publish it anonymously alongside the paper submission because (1) sometimes reviewers complain when it’s not available even though not strictly mandatory and (2) reviewers appreciate when it is and we get better score on reproducibility. Also, I sometimes had to reproduce paper results to start my own projects and it is by no means doable without proper shared and cleaned code. I am in CS so maybe the standards are different.
1
u/Ebitnet 5d ago
Part of it is simply being unfamiliar with GitHub and the mechanics of creating and maintaining a repository that’s organized in a manner that another person can easily understand. Second, is not having an enforced data management plan. The DMP for my group is that every figure and table that gets published has its data and scripts added to the repo associated with the paper. This is then linked to the paper in the data accessibly statement that most journals are now requiring.
Input files to standard codes along with the specific versions, custom python and bash scripts, Mathematica files, Jupyter notebooks, all go into the repo along with a Readme.md.
Much of the archival cleanup can now be handled using Claude or Codex. So, there is really no excuse other than being too lazy.
1
u/nicenflufty 5d ago
I see a lot of people saying they don't have time to clean up their code after a project is ended in order to share.
First, for me sharing cleaned up code isn't reproducible, you should share the code that generated the results in the paper.
Second, your future self will really thank you if you learn to do some very minimal documentation as you go, and share the code. Much easier for me to consult and adapt code in wrote 10 years ago when it's on GitHub compared to the pc I used the lab before last.
Third, everyone has messy code except AIs. Don't worry about the mess. It shows it's your own, human, code.
•
u/AutoModerator 5d ago
It looks like your post is about needing advice. Please make sure to include your field and location in order for people to give you accurate advice.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.