Ugh. My efforts are being frustrated. There is a bug.
At some point, I introduced a bug. As the user moves from one screen to another, there is a null reference error. And I cannot figure out why it is happening. It’s my own fault, though.
A few things have happened, all bad practice, that have put me in this frustrating position. First and foremost, I have not pushed changes for working features to GitHub. I have implemented a whole bunch of changes since the last stable version that exists on the main branch. Second, I was hacking at the app trying to get the data persistence to work. Now I’ve figured that out, but in the hacking, I made all sorts of changes. That brings me to my third bad practice: I’ve only been engaging in cursory documentation as I hacked at the code. So, I have changes all over the place that were mostly just guesses and no clear indication of what I was trying to do or if it worked.
For the last like two weeks I’ve been working my way through the code, trying to clean it up. And I still haven’t uncovered the source of the null reference error that is occasionally, but persistently, appearing and causing the app to break. It is slow and frustrating. It’s also boring as hell. I enjoy coding, and I even enjoy debugging when it’s in service of solving the issue at hand. I hate this, though. And I feel justified in hating this because it could have been avoided if I’d stuck to a design-first, incremental approach. If I had Done. Things. Right.
So, I am going to roll back to the previous stable version that exists in git. Even though that means redoing a couple weeks worth of work. It also means I can do all of that work right. Here are my priorities as I rebuild from the last git version:
- Design, implement, test incremental changes
- Document code changes thoroughly
- Push stabilized changes to git
I always tell my students, look for your errors and correct them if you can find them. If you’re not sure why you’re getting the wrong answer, though, it’ll probably be faster to just start over than to hunt for your error. Plus, you’re likely to be more confident about your work when you rework the problem.
I know this to be true. So, after wasting time hunting for my mistake, I’m just going to restart and work carefully. These presents an interesting opportunity to improve the quality of my work and I’m excited to get it done.
Featured image source: pxfuel