This week I rewrote SeeCollections, a data visualization application that I had originally built in 2015. The rewrite was sorely needed, for a couple of reasons:
- The original code was really bad. Which is to be expected; I was a beginner when I wrote it. The newer code is better. It’s clearer. It went from over 400 lines of code to under 200, while maintaining the same functionality. It will now be much easier to debug.
- SeeCollections was originally based on the Primo X-Services API, which is now deprecated. For my application to keep working, I needed to move it to the newer Primo Search API. An added bonus was that the new API works with key-based authentication, which allows for more deployment options than with IP-based authentication.
- I wanted to move this project off sdf.org. SDF a wonderful hobbyist community, but the infrastructure is sometimes hard to work with. SDF is a few thousand programmers sharing a handful of servers, which results in all kinds of strange and unexpected technical roadblocks. It’s fun to tinker with, but not to rely on. Key-based authentication allowed me to move this to PythonAnywhere, which uses dynamic IPs, and is more reliable than SDF.
I had been putting off the rewrite, because it seemed like a lot of work, but now I’m glad I did it. I don’t have to look at the previous code anymore, and the whole project is now a lot more reliable and maintainable.