You have to make a conscious effort to keep your code base DRY. Every time you make a change, add a feature, or fix a bug, make an effort to find duplication and to determine design patterns. This will play a huge role in keeping your code DRY, and maintainable in the long run.