1. Abstracting a problem
2. Encapsulation
3. Code efficiency
4. Speed \ Quantity
5. Simplicity
6. Readability
2. Encapsulation
3. Code efficiency
4. Speed \ Quantity
5. Simplicity
6. Readability
Try Project Euler as a casual way to improve you skills in this area, it's been a good mental exercise for using programming to solve math problems with your favorite language. Solving the problem is the primary objective, but you can always go back and make your code better after the fact, learn new functions and techniques, etc.