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:
Clean Code by Robert C. Martin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With