|
It seems like every few months I read some new way of articulating the idea that code that's hard to maintain and modify is frustrating. Some, like this, don't really pose solutions, some do, but most I think fail to realize that their advice inevitably falls apart in some case Extremely modular/functional code can require understanding more separated moving pieces, which may well be scattered to the winds in a zillion different files and combined in clever but counterintuitive ways Extremely object-oriented code has lots of mutability, inheritance, and encapsulation gotchas that make users of an API less likely to understand what's happening under the hood of some class Extremely terse code can be difficult to parse the logic out of,
extremely verbose code can take forever to read and be hard to hold in your head,
extremely abstract code can be hard to parse out how it accomplishes the application,
extremely purpose-specific code can be ridiculously idiosyncratic and be hard to separate into digestible pieces, and so on and so forth. I've heard a lot of code organization advice and could keep doing this for hours. I had a student tell me a personal project's codebase looked like the necronomicon once after an overhaul I made to make it more readable from my perspective There are sometimes takeaways from all these analogies and policies and just generally opinions about how to write code people can supposedly maintain or modify or read more easily, and I definitely use and take some of them to heart. But most advice is really bad at generalizing, and I often feel that the most readable style of code is whatever one that I prefer and can convince people who work with me on it to prefer (Or, you know, vice versa as the case may be) |