The mortification of seeing one’s old code

This website was hosted for at least ten years on a traditional hosting service. Last time around I paid for three years in advance to get a discount, and that three-year term will be running out this fall. In the meantime, technology has shifted: PHP used to be de rigeur for website design, but the modern approach is to create static HTML pages on your development machine and deploy from there. And you no longer pay a service to do this: you just put it on GitHub instead. Always willing to save money, I spend a few hours converting my PHP website into a modern statically generated web site. This has occasioned reflections about how technology has changed over the last ten years, and how I’ve changed with it.

The web site itself

I developed the site on my local machine using XAMPP, which was software that ran an Apache web server, PHP, and SQL on my local machine. I then uploaded files to the remote server using WinSCP. It felt pretty high tech.

I dropped out of web development in the late 90s, and got back into it around 2007. Much had changed. PHP blended computer programming and HTML in an exciting way. It opened up a lot of possibilities—even if, as in my case, it was mostly just a matter of using it to handle page templates. Indeed, probably even by the time began to use it, PHP was already just caching the page it generated on the server. In that respect, the current regime of generating static web sites cuts out the middle-man. I’m not complaining about saving the $7/month for web hosting either. ;-)

I have also updated the site from HTML 4 to HTML 5. I personally liked creating HTML files that were also XML files, but I can understand that few others did—and that some others couldn’t. Probably the widespread use of markdown is the logical end of this process. (This file is written in markdown.)

CSS has remained quite stable.

Version control & GitHub

This has been the biggest (and best) change over the last ten years. I marvel that we got anything done in the days before version control. I certainly remember copying my source code files before making big edits, in case something went wrong that I couldn’t figure out later. With the commit system, making big changes are far less scary. I also believe that thinking about commits has helped me to modularize my approach to coding. Rather than going in and changing whatever felt wrong, I’m now nudged to make discrete steps for specific problems. There are not a lot of instances where new technology encourages intellectual virtue, so I am glad to celebrate that one.

GitHub has made it all the easier—the centralization, the GUI tools, etc. But also now through hosting README files. During my last major revision of this site, around 2012 or 2013, I created separate web pages for each software project. This time around, I have moved all of that content to the repositories themselves. That’s much more satisfying; the documentation stays with the code.

Programming languages

Most of the core technologies have stayed the same. I program the most in C/C++, using SQL and XML as file formats. C++ has only gotten better with time. SQL and XML continue to be workhorses. I’ve never regretted investment I made to learn those technologies. (Even XSL!) In C++ I generally work with the Qt framework, which has remained very stable—at least the parts that I use.

The one real moving target has been web development. This is a perennial frustration. I do web development only very occasionally, and it seems that after a year or two the best practices have shifted entirely. The frustration of course is that you never know when it will shift again. I am still maintaining code for a project that I wrote using a blend of PHP and jQuery.

For now, everyone seems to have settled on Javascript as a language, but the frameworks seem (to me) to be constantly shifting. I feel very little incentive to do anything but hack my way through my various small projects, because it’ll all be different in a few years anyway.

The programmer

A negative of source control is that it preserves code you would rather forget! It’s galling to glance over old code and see obvious blunders. It sets my teeth on edge. And it’s not as if this was student code; I was all grown up and educated when I wrote it. But at least I have the consolation of knowing that I have grown in the interim. (It would probably be more disturbing to look back after ten years and be coding the same way!)

The software I appreciate the most, and that I now use the most, are the simple applications that make me more productive:

There are also some niche programs that, while I don't use them now, certainly had their day. I notice that a lot of my programs are called “workspace.” I think that summarizes my interest in programming in general. I have a personal interest in writing the software correctly, but I’m only ever interested in what I can do with it. Particularly for repetitive tasks, I want the tools to work just right.

It’s been interesting as well to think about what I saved, and what I spent so much time on. I don’t recall how much time I spent on the Chess program, but I know that I ended up using it very little. Hot Potato similarly was truthfully more about my interest in the programming task than wanting to play hot potato with my sons. (I don’t recall that we used it much in the end.)

Much of the software I developed for the Wakhi Language Documentation project holds up. The programs that I wrote for my language helper were critical at the time, though I have not used them since. (I have since created other simple software for other projects. It’s been well worth my time to do so.) The XSL transformations that I archived and documented so carefully… it seems a bit quaint to me now. I must have been very proud of them at the time, but these days I would probably recreate them from scratch rather than bother to look for the old code.

Gloss, from the Wakhi Language Development project, was critical at its time, and the data structures were good. It was the predecessor to Mortal Engine and the associated utilities. Gloss had sort of a terrible ad-hoc morphological feature. When I returned to the problem, I knew that I didn’t want to do that again. (I was also much more intentional about good programming style in Mortal Engine.)

Historical Phonology Workplace is really a curiosity. I never ended up doing serious work in historical phonology, so it remains where I left it. The design is also comically bad: I’m rendering tables in HTML using data I collected from a C++ program. (Almost all of the logic is in one giant class, full of long functions.) It’s as if I had an intuition that HTML and Javascript should be made to work together with serious logic, but I had no concept of how to implement that. (And perhaps no sense to realize that if no one else had done that before, maybe I shouldn’t have been the first to try.) It was good of me to try to document it.

(What does one do with old code like that? It’s embarrassing to put it on display, but it feels vain to delete it.)

All contents © 2024 Adam Baker, except where otherwise noted.