Hacker News new | ask | show | jobs
by jvalencia 1410 days ago
I've not gone through several inherited codebases. At first I called them awful --- however, as I've gotten older, I realize that code is harder to read than most people think. We are trained to follow a particular set of styles, linters, testing strategies, etc.

When we sit down to an inherited code base, we don't know what they were doing, so it looks terrible. There might be a very simple key that you'll never figure out until you've spent a lot of time reading the code. If you go adding code that doesn't jive with the hidden premises, there will be conflicts that you create, which you'll blame on the old code, even though it was your lack of understanding that created it.

1 comments

My experience recently (3 or 4 separate projects) has been the opposite - at first the code looked fairly neat and well organized with few obvious smells, but the more I worked with it I realised how many functions/modules were poorly named and/or handled bits of unrelated functionality in a single place or adopted inconsistent conventions or made unnecessary assumptions or relied heavily on global variables (or the equivalent thereof). The best code I've worked with has generally been open source libraries that have well- defined limits to their functional scope.