I see it 'very often.' Most research paper code has no reusability—they just implement the algorithm.
So I can see why it might be considered low-quality. They don't use things like Result or policy types like we do in production code. But they're modifying or creating new algorithms, right?
The thing is, they don't need to do those things, so it looks lower-level—but the algorithm implementations themselves are actually pretty good, aren't they?
PhD thesis code often looks low-quality simply because there's no reason to reuse it like production code. The tensor computations inside are things that typical programmers can't easily do.
The point I'm making is that the core algorithmic work is something most programmers can't handle. And that's natural—highly skilled programmers have already built deep libraries for that.
When I talk about PhD-level code, I'm not referring to overall code quality. I'm talking about the level of the algorithms themselves.
> there's no reason to reuse it like production code.
This strikes me as a self-fulfilling prophecy. There are probably many people who would like to use the code published with PhD level research, but they don't because the code is not easy to adapt (or sometimes even to get running).
Then a decade later someone implements that same algorithm in a library with a well-designed interface and it suddenly becomes a useful tool for others. So ultimately there was a reason to reuse it, it was the quality of some aspects of the code that held it back.