Perspective for (2): it's because no one in graduate training really cares about code quality. Your PI focuses more of your attention on scientific writing, and so there's little to not time to polish your work. The incentives just don't support this work at the graduate training level.