In industry, what I've seen is that often engineers are scrambling to please managers or customers, with work divided among multiple people, so the code is usually poorly written and undocumented.
In academics, publications are of primary importance, so everything is documented. The longer timescale means there's more time to refine code that's designed for a single, focused problem. The limited scope of the programs used means code quality isn't an issue most of the time.
Also, in theoretical computer science at least, the focus is entirely on rigorous proofs and finding optimal algorithms. While in industry, it's more "get practical things done quickly so we can sell it".