문제

I'm a computer science student, and I'm just starting to write relatively larger programs for my coursework (between 750 - 1500 lines). Up until now, it's been possible to get by with any reasonable level of modularization and object oriented design. However, now that I'm writing more complex code for my assignments I'd like to learn to write better code.

Can anyone point me in the direction of some resources for learning about what sort of things to look for when designing your program's architecture so that you can make it as modularized as possible?

도움이 되었습니까?

해결책

refactoring by martin fowler is the book that has helped me most among the 20 or so books that I have read on oo, patterns, test driven development and general software engineering over the last two years. particularly the section on smells can help you see what you need to avoid as you are developing more complex code.

다른 팁

This question has been asked here before, and the answer has generally been there is no such book. The reason for this is that there are no "rules" that can be applied to the problem - you have to go on experience. My experience is that you should write multiple libraries with a clear, singly directed dependency graph, but beyond that I wouldn't like to commit myself.

Read Clean Code by Robert Matin

There is one important thing which will make it easier when developing modular apps, or even turning an app modular at a later point, which is Dependency Injection.

It allows your modules to work separately of everything else, as it receives whatever data it needs to perform its task, without needing to know anything about the application itself.

It may take some experience to produce good quality context-neutral DI code, which is why it's important to begin thinking about and experimenting with it as soon as possible.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top