Comment on Linear code is more readable
macgregor@lemmy.world 1 year ago
Knowing what and when to abstract can be hard to define precisely. Over abstraction has a cost. So does under abstraction. I have seen, wrote and refactored terrible examples of both, written by myself and others. Anecdotally, flattening an over abstracted hierarchy feels like less work and usually has better test coverage to validate correctness after refactoring than abstracting spaghetti code. Be aware of both extremes and try to find the balance.