Some basic guidelines to reducing redundancy:
- When you find yourself copying and pasting the same chunk of code to use elsewhere, think about putting it into a reusable method.
- When you need to reuse code in different files (i.e. other classes) you'll need to explore creating utility classes (helpers). For this you'll need to learn how to construct your own classes, and where you can put them in order to reuse them.
- When you need to reuse code in different assemblies (i.e. other applications) you'll need to explore creating shared class library assemblies. For this you'll need to learn how to work with binary/project references and namespaces.
Unfortunately, there is a lot to learning how to write code efficiently. It is very much a crawl/walk/run metaphor. As Rob said, only years of experience will make you very efficient. In spite of that, you'll always find a better and faster way to do something. No one can become an expert overnight.
-Peter
compiledthoughts.com