I can write small programs and solve individual problems, but I want to learn how to organize a codebase that grows to thousands of lines. What resources or principles help with maintainability without treating one design pattern as the answer to everything?
How do I learn to structure code beyond small programs?
Answers
The Pragmatic Programmer is a good place to start for broader software design habits. It covers more than a single architecture or pattern, so it may be closer to what you're looking for than a catalog of techniques.
Design Patterns is useful too, but I would read it as a collection of possible solutions, not a blueprint for every project. Recognizing a problem matters more than finding somewhere to insert a pattern.
Reply to this answer
Start with the kind of software you want to build. A library, a game and a cloud service have different constraints, so there isn't one layout that makes all three maintainable.
For a concrete project, think about which parts have different jobs and what information they need to exchange. Then use the conventions of your language and its tooling where they fit. The problem should drive the structure, not the other way around.
Reply to this answer
Don't overlook your language's package manager documentation. If you're building a package or library, its expected directory layout and discovery rules give you a practical starting point. Python and Rust both have tooling conventions worth checking before inventing your own structure.
Reply to this answer
Clean Code and Clean Architecture are options if you want an opinionated view of design. Take their prescriptions critically, though. Some developers find that style useful, while others prefer flatter architectures or disagree with its recommendations. You don't have to adopt the whole philosophy to get something out of it.
Reply to this answer
Add your answer
Answers are reviewed before publication.
2v!socketthimble_581:
That makes sense. So the same pattern might be useful in one part of a game without needing to organize the whole game around it?
_q73!torvexa.6:
Exactly. You can choose a technique for a particular problem without making it the rule for everything else.