“Il semble que la perfection soit atteinte non quand il n’y a plus rien à ajouter, mais quand il n’y a plus rien à retrancher.”
Antoine de Saint Exupéry
(“It would seem that perfection is attained not when no more can be added, but when no more can be removed.“)
Once upon a time, I was proud of creating 1000+ line-of-code-functions that does amazing things (that was in C), later, I went on adding unrelated methods to add witty capabilities to a class (that was C++). Fortunately, I’ve been learning better and took the time to look back at these experiences (see on learning).
St Exupéry’s quote applies perfectly to programming and removing the unnecessary stuff lead to more beautiful code (and also easier to understand, maintain, extend, etc). For the past few months, I’ve been trying to remove code as hard as adding new one. That’s a case where a good test coverage is deadly required.