Writing clean, elegant code is what makes coding a pleasure for me. I'm always looking for more ways to do so. Here are some of my strategies/tactics:
Keep large code blocks in smaller chunks of routines/methods/classes
Be sure every routine has one point of exit. Exit loops with logic at the top of the loop, not with breaks or some type of "exit loop" keyword.
Avoid globals
If you just performed a copy/paste with your code, it is time to create a routine/class/library.
...and one I've been toying with lately:
- Try to replace if/branching/select cases with different method signatures (polymorphism) Clean Code Talks on YouTube