Nate Meyvis

Why is there so much bad code at big companies?

Here is the excellent Sean Goedecke on why there is so much bad code at big companies. He's correct that:

  1. Many big-company engineers are working on relatively unfamiliar codebases, and this makes it harder to ship good code;
  2. Big companies prioritize things (e.g., legibility) that are not code quality;
  3. Code quality is partly a function of the code-review process, but code review is incentivized unevenly at best.

(Those are all my paraphrases.)

Those are all correct, but I don't think they're the most important drags on code quality at big companies. I'd cite these:

  1. Encapsulation is the main determinant of code quality; most engineers have not mastered encapsulation; and even 95th-percentile engineers struggle to get encapsulation right.
  2. Encapsulation is much harder at big companies, because systems have to be more complex at their scale. Simple solutions either don't work at all or carry costs that are negligible at modest scale but huge at big-company scale. (Authentication, load balancing, and version control are good examples here.)
  3. In some big-company cultures, caring too much about micro-level code quality is punished: it marks you as someone who's insufficiently serious about system design and "higher-level" issues more generally. There are places where you really don't want to look like a sous-chef.
  4. As I've discussed before, over-complicated code often benefits the person who wrote it: they are uniquely positioned to maintain and fix it. Even though most engineers are not Machiavellian schemers, incentives matter.
  5. Good code is a matter of craft, and often subtle; it's hard to recognize and reward at scale. (See, again, this piece and this more optimistic one.)

#sociology of software #software