In order for software development to be sustainable—that is, in order for us to rapidly build features now and easily extend them in the future—we must pay attention to maintainability.
Here are five of the items on my short list for writing sustainable code:
Dead code—code that’s never executed because it’s commented out or no longer being called—serves absolutely no purpose except to distract developers.
Delete it.
If for some reason you actually do need it, it’s in the version control system so you can roll back, get that code, and add it back to the working system as needed.
Rename methods and classes to have good, intention-revealing names. As you go through the process of building ...