My experience with academic code is that it's all ad-hoc software that's written to solve a single problem for a single paper. Once the final draft of the paper is peer-reviewed and published, there is no longer any reason to ever touch that code again.
From a practical standpoint, why invest in future-proofing your code if it's going to be thrown away once the current paper is finished? No need to make the code readable for the next author, no need to document it, no need to make your code non-monolithic because you're never going to build on top of it later.
On top of this, they were never educated and trained as software engineers. If you're lucky, they may have a pure CS background (and some of the worst code I've seen has been written by academic CS people who are explicitly not software engineers), but most likely they come from various academic disciplines that don't teach how to write code.
I used to work at an academia-focused NLP company, and while they did have some well-structured long-lived projects that we used across several projects, there were also large piles of code that you can tell were just intended to be used once and then forgotten about.
This also reminds me of the way Japanese console developers, such as Squaresoft, used to treat their source code in the '90s. Once the game shipped, they would just wipe the source code from their hard drives and their backups to save space. Hey, it's a pre-2006 console game, it's never going to get patched after release, and this was long before the nostalgia bug bit and publishers realized there was money in porting old games to new platforms. Hey, if you believe that code is only ever going to be used once, you are going to treat it as throwaway code, and that includes actually throwing it away at the end. As a result, many later ports of '90s console games were remade from scratch, consist of old ROMs running in an emulator (sometimes romhacked if the game had never been translated before, like Trials of Mana), rebuilt from a third-party port of the game, or if they're really lucky rescued from early beta code stored on an old computer they forgot to wipe (this is how the FF7 PC version got made in fact). There was a Twitter thread recently, and it's absolutely fascinating.
From a practical standpoint, why invest in future-proofing your code if it's going to be thrown away once the current paper is finished? No need to make the code readable for the next author, no need to document it, no need to make your code non-monolithic because you're never going to build on top of it later.
On top of this, they were never educated and trained as software engineers. If you're lucky, they may have a pure CS background (and some of the worst code I've seen has been written by academic CS people who are explicitly not software engineers), but most likely they come from various academic disciplines that don't teach how to write code.
I used to work at an academia-focused NLP company, and while they did have some well-structured long-lived projects that we used across several projects, there were also large piles of code that you can tell were just intended to be used once and then forgotten about.
This also reminds me of the way Japanese console developers, such as Squaresoft, used to treat their source code in the '90s. Once the game shipped, they would just wipe the source code from their hard drives and their backups to save space. Hey, it's a pre-2006 console game, it's never going to get patched after release, and this was long before the nostalgia bug bit and publishers realized there was money in porting old games to new platforms. Hey, if you believe that code is only ever going to be used once, you are going to treat it as throwaway code, and that includes actually throwing it away at the end. As a result, many later ports of '90s console games were remade from scratch, consist of old ROMs running in an emulator (sometimes romhacked if the game had never been translated before, like Trials of Mana), rebuilt from a third-party port of the game, or if they're really lucky rescued from early beta code stored on an old computer they forgot to wipe (this is how the FF7 PC version got made in fact). There was a Twitter thread recently, and it's absolutely fascinating.