One Little Code Change

David Blume
2 min readNov 17, 2018

--

I have a rarely-used email account for password resets and such. Since that’s all it’s for I don’t monitor it regularly, because it should only get email when I request the password reset myself.

But then what if it gets email for another reason? I’d want to know. So I wrote a one-off little script that monitors the email account, and updates an RSS feed, so I’ll see an entry in my feed reader, which I do monitor daily.

It’s been working fine for years. No need to change anything. Except I decided I wanted to update it from Python 2 to Python 3. For no good reason.

I’m not going to productize it or add new libraries. Just make it work in Python 3. That’s it.

If I’m going to make this change, I better have a backup of the original file, because my first attempt is surely going to fail. I’ll use Git for that. And if I’m using Git, it’d be nice to have a copy of the repo in the cloud, so I’ll use Github for that.

A partial screenshot of the actual project.

If I’m putting a copy of my one-off script on Github, I better add a license file to it.

If I’m putting a copy of my licensed script on Github, I better extract the private data to a separate file, and add a little private data reader.

If I’m putting my private data in a separate file that I don’t want to get on Github, then I better add a .gitignore file, to ensure it doesn’t get uploaded.

If I have to configure the script because it’s got a config file now, I better add a README file.

If I’m going to add a README file, I better make it clear at first glance to new developers whether this really does anything or whether it’s a high school homework project. So I’ll add some Code Climate badges so readers can quickly tell how maintainable it is, and which languages it uses.

If I’m adding the Code Climate badges, I may as well add a Code Climate YAML configuration file.

And then, I can upgrade my little Python 2 script to Python 3, leaving a little “python2” branch at the old revision and a “python3” branch as the default branch.

That’s the story of how a long-lived one-off 100-line script turns into a multi-file Github project with a README file that’s nearly as long as the script itself.

…Without even doing anything new. It’s just the same old email checker.

--

--

David Blume

A rock-climbing father of two and software developer.