5 Tips to Become a Productive Coder
- Avoid distractions. Programmers are usually computer savvy and will have a variety of applications open all day. Close down your RSS reader, Twitter client, etc and stick to a few hours of solid coding per day.
- Avoid pre-mature optimization. You may not even keep the part of code you are writing right now, so why spend the effort to right it and optimize it if you will end up throwing it out anyway?
- Write DRY (Don’t Repeat Yourself) code where possible. Don’t get carried away though. Err on the side of code readability over DRY where possible.
- Write tests. Fixing a bug? Write a test. Added a new feature? Write a test. Don’t worry so much about TDD, BDD, or xDD. It’s more important that you write the tests rather then when.
- Write modular code. If you find yourself writing a lot of comments inside of your methods, you should probably break them up into separate methods.
That’s it. A lot of the things described may actually take you a little bit longer, but they all pay dividends. Bug fixes, re-factoring, and general maintainability will all greatly improve.