Wisdom from Robert Martin of Clean Code

Wisdom from Robert Martin of Clean Code

Some really wise quotes:

No matter how bad your legacy code is, never EVER create a project to ‘clean up the code’. It will never get completed, you’ll inevitably have to stop, and it will end up worse than you started. This has happened every time in my experience.

The only proven way to get out of bad code requires EVERYONE on the team to get on the same page of how code is supposed to be written. Make them take the Clean Code class/read the book and then use the boyscout approach. That approach is every checkin you check in the code a little better than you found it. That’s it. In time, those little refactors move the ship in the right direction, become dominant, and then surround and destroy the bad code.

Code that has not been touched for years likely doesn’t NEED to be touched. Sure, it may be messy, but if it works, there’s no point in spending time on something you aren’t going to improve functionally.

Code reviews are largely useless. People go in, listen for 5 minutes and then at the end everyone leaves saying, “I sure hope he knew how it all worked because I toned out.”

TODO comments are fine, but should be completed before submission and never checked in. After they are checked in, they become TODON’T comments because they never get completed.

If people get into an argument about syntax/details and it lasts more than 5 minutes, then neither person has solid evidence for why it should be their way. Just flip and coin and move on.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.