Studying Latin in high school, I was perplexed by the phrase festina lente (“hurry up slowly”). On its face, it’s an oxymoron, but it became an aphorism – and has stuck in my head for a quarter century – because it expresses a profound truth. We should aspire to achieve our goals quickly but without moving so fast that we trip ourselves or drift off in the wrong direction. We must regularly adjust our course and run slowly enough that we don’t run off a cliff or twist an ankle stepping in a rabbit hole. I mention this because I failed to do this on my PowerMandarin project and am now suffering the consequences. First, the good news: Every change I’ve made to my website has been stored in a “version control system” (Git), so I have been able to roll back in time to February and am now going through all my subsequent changes and re-applying the good stuff. I’ll then go back again and look carefully at possibly problematic changes. But I should have avoided this whole nasty mess. I made two inexcusable mistakes. I’ve read a number of excellent books on how to program (including: Ship It!, The Pragmatic Programmer, Code Complete, Practices of an Agile Developer, etc.). They all stress: 1) Write a solid test suite with broad coverage of your program; and, 2) Change your code in small chunks and test each chunk before moving on to the next chunk.
I’ve had these concepts drilled into my brain. But only after discovering that something since February broke several JQuery/Ajax features on my website have I FELT the need to create a solid test suite and use small “topic branches” to implement new features in isolation from other code changes. I made several months of changes in my “master branch” before realizing something had broken several JQuery/Ajax features. The suspects were too many: Upgrades to Rails, upgrades to JRuby, upgrades to JQuery, upgrades to JQuery plugins, upgrades to rails.js, upgrade of pagination.js, replacement of the will_paginate gem with the kaminari gem, etc. Had I written a comprehensive test suite that exercised my JQuery/Ajax code and tested my changes before committing them (ideally using a “continuous integration server”), I would have immediately detected the problem and known what caused it. Instead, I’m stuck wading through months of code patches. Never again! Another key lesson learned – at great and avoidable pain – in my march to become a quality programmer.