Elektrine lite

โ† Feed

@ngaylinn@tech.lgbt

Post #2142635

2025-02-03 22:32 UTC

Has anyone ever seen code reviews working well in an academic setting? One of my lab mates just paid a very high price for a small bug, and we're talking about using code reviews to prevent this. Coming from industry myself, I like this idea and volunteered to help figure this out, but I can also imagine lots of reasons this might not work in a lab full of grad students and postdocs. In particular, I'm worried about training people to actually give good code reviews, sharing the workload fairly, and agreeing on a standard for code quality. I'm very familiar with how to deal with those issues on a software engineering team, but they would all be very different in this setting... #academicchatter #computerscience #compsci

Replies (11)

  • @ngaylinn@tech.lgbt I don't have direct experience but I'd look to @gvwilson@fosstodon.org, @thecarpentries@hachyderm.io, Software.ac.uk, and https://book.the-turing-way.org/

    Open ##2733464

  • @elduvelle@neuromatch.social 2025-02-04 13:41

    @ngaylinn@tech.lgbt we have done it a tiny bit in one of my previous labs and I found it really useful. I think we should all do it all the time. I'm pretty sure @jonny@neuromatch.social will have lots to say about #CodeReview in #Academia!

    Open ##2733466

  • @cian@mstdn.science 2025-02-04 14:07

    @ngaylinn@tech.lgbt i'd say any kind of code review, even if informal and half-baked, is better than none at all? don't let perfection be the enemy of the good etc etc

    Open ##2733472

  • @MichaelTBacon@social.coop 2025-02-04 14:14

    @ngaylinn@tech.lgbt It's a small thing and it doesn't catch everything, but coming up with a pylint or pyflake config that everyone can agree on and adhering to that, then configuring it to enforce a base level before check-ins are allowed. It feels like a "mother may I" step but I've found it catches a LOT. This isn't the same as code reviews, but it's a starting point for discussion on code quality and standards which can facilitate getting to code reviews.

    Open ##2733487

  • @dn_mason@mas.to 2025-02-04 14:16

    @ngaylinn@tech.lgbt feels like something on which @steveroyle@biologists.social might have some useful insight.

    Open ##2733488

  • @jonclayden@mastodon.online 2025-02-04 14:18

    @ngaylinn@tech.lgbt We don't do code reviews internally, but I've been involved with reviewing for @rOpenSci@hachyderm.io, which was well thought-through and constructive (https://ropensci.org/software-review/). A slightly different scenario, perhaps, but worth looking at on standards, procedures, etc.

    Open ##2733491

  • @HeidiSeibold@fosstodon.org 2025-02-04 14:46

    @ngaylinn@tech.lgbt I wrote a newsletter post about exactly this topic. Maybe this helps ๐Ÿ˜‰ https://heidiseibold.kit.com/posts/code-clubs-good-coding-practices-for-all Thanks @da5nsy@social.coop for making me aware of this discussion ๐Ÿ‘

    Open ##2733492

  • @williampietri@sfba.social 2025-02-04 15:17

    @ngaylinn@tech.lgbt I think you're right to be cautious. The economics are so different. The quality practices that make sense for a long-lived code base maintained by many people may not pay off for a short-lived, single person effort. One way I think about quality practices is bringing natural consequences forward in time. So code reviews could be seen as bringing a later WTF moment to when it's easier to change. Might you be able to do that here?

    Open ##2733497

  • @joeroe@archaeo.social 2025-02-04 16:06

    @ngaylinn@tech.lgbt Yes, and it works well, but then we're a (very) small team and all happen to have some background in software engineering. If I were to integrate software reviews into a more typical lab, I'd say they'd have to fit to the different structures of academia (i.e. where your PI is or should an expert in what you're doing, not an expert in management). So the PI or other senior person in charge of supervising graduate students or postdocs should be reviewing code, as they likely do papers.

    Open ##2733505

  • @ngaylinn@tech.lgbt This is something I'm very interested in and I think collecting and sharing case studies like what happened to your lab mate is a big piece of getting buy-in from academics. We've got a code-review working group at @us_rse@fosstodon.org and part of what we discuss is how to get lab groups to do peer code review. Would love to have you join the discussion!

    Open ##2733506

  • @nrennie@fosstodon.org 2025-02-04 18:10

    @ngaylinn@tech.lgbt I recently ran a workshop for PhD students and postdocs on writing better code (aiming to write code that is easier to share with other people) and we did a session on GitHub and code review as part of that. My resources are here if they are helpful: https://nrennie.rbind.io/training-better-r-code/ and https://nrennie.rbind.io/training-git-r/ This blog post by @_jcken@qoto.org also has a lot of good advice that's very relevant for code review in academia: https://jcken95.github.io/projects/code_review.html

    Open ##2733507