2019 In Programming

This was a VERY busy year for my coding. This year I had over 769 commits to GitHub; my previous best was 58 in 2014. The commits were very unevenly distributed. If you look at the graph of my commits, outside of a busy week in January and another in May, I didn’t really start coding until August.

GitHub activity graph

But perhaps commits to GithHub isn’t the best metric. If you look at what I accomplished in the second half of 2019, I worked on an incredible number of projects.

Extra Life Donation Tracker

Let’s start with my most ambitious and most used project, the Extra Life Donation Tracker. I’ve got people that want it to work and so file bug reports on GitHub for the code. Out of 20 releases on GitHub, 18 were done this year. GitHub’s CI system, GitHub Actions was releases, allowing me to use that to run a linter and tests against my code and create Windows and Linux binaries automatically from every release. I also finally reached the goal I set out with for this code years ago – to have a working GUI. Once I had the GUI setup, I started a major refactoring to make the code more maintainable and less error-prone. It is my programming magnum opus, and I’m very proud with where it has ended up.

Impractical Python

I got Impractical Python via a Humble Bundle after having avoided skipped it on a few other Python bundles and experienced some serious FOMO. Having really seriously begun coding in earnest this year, I decided to go ahead and grab it. (Yeah, yeah – any individual Humble Bundle is an awesome deal with tons of books for $15-20, but some months I’ve spent $100 on these great deals to get more books than I can likely ever read) In the first chapter I learned about pylint and pydocstyle. It’s not an exaggeration to say that learning these tools changed my programming for the better. Having been mostly self-taught, I don’t usually have the best style. By applying pylint to both my Extra Life Donation Tracker and my Amortization project (more about that next), I ended up with WAY better code. How? Making my variable names more Pythonic forced me to do away with any “i” and “count” variables that made going back to my code a LOT harder. Adhering closely to the column count helped me make the code more readable by controlling where it wraps around. And a measure of complexity helped me realize where I was being a little too complex with my amortization code. At the end of 2019 I also did chapter 2 and learned about profiling with cProfile. I’ve been tracking my progress and solutions to the book’s problem sets on GitHub.

Amortization Table

A little over 7 years ago, I started work on a program to calculate the amortization table for mortgages (also works for car payments) when the debtor is paying extra, but not the same amount every month. Then I wanted to make a GUI to make it easier for my wife to choose. At the time, the only way I knew how to make GUI was with QML. The result can be found here. Time passed and I learned QT via a book I got on Python GUIs with QT using QT Designer. So, on an 8-hour car trip with my dad, I set about to update the code and add a GUI. When I looked at the code, it was screaming with the need for refactoring – I was repeating the same thing twice – once for printing to the commandline and once for exporting to CSV. This made twice the work when I discovered any bugs. So, armed with pylint, pydoctstyle, and QT Designer, I set about updating the code, fixing bugs, and making a nice GUI. The result is here.

Amortization GUI with Plasma-style button
Old Amortization GUI written in QML
The new, QT GUI I created this year

Math Generator

We wanted to be able to have a randomly generated problem set for our oldest to ensure she was learning math and not just memorizing answer order. So, with some help from redditors, I created this program to make LaTeX formatted worksheets. My wife was happy that, for once, my programming hobby was useful.

Star Wars Spoiler Generator

When I saw this XKCD comic, I saw something that was ripe for easily making into a program. So I made this webpage, with this code. It was quick and easy and a lot of fun.

MQTT2DB

Rounding out my Python programming for 2019 was this utility I wrote to take MQTT data (commonly used by IOT devices to communicate data) and format it for a time-series database, like InnoDB. This is going to end up being a key backbone of my IOT journey into home automation.

DrawBot

After not having touched embedded programming since undergrad, some 15 years ago, everything changed for me when I saw the Humble Bundle with the Arduino and Lego Mindstorms book. I figured it was something I could do with my oldest, who’s into Lego and would probably enjoy turning those legos into robots. So I ordered my first Arduino (Uno R3) and shield (Mindstorms shield created by the authors of the book) and we set to work. We created this:

The Drawbot in Action

It was a lot of fun and it reignited my passion for working with embedded programming.

BBQ Thermostat & Bathroom Home Automation

With my knowledge that programming for embedded processors was now easier than it was 15 years ago and had a thriving ecosystem behind it, I decided to use it to develop a BBQ Thermostat for my smoker. There are many commercial solutions out there, but most of them rely on proprietary apps and servers that, if they go down, would loveleave my $300ish purchase useless. With even Best Buy shutting down their Insignia IOT services recently, what hope do I have of these smaller companies to stick around? Since I had experience with Arduino from the Lego project, I took a look through their product line first. The MKR 1010 looked pretty awesome because it was smaller than an Uno, had WiFi built in, and a k-couple temp probe shield that was easy to interface with. So, by the end of 2019, I had this code in this repo and had done a live test of the temperature measuring part. Although I still have some kinks to work out and still have the fan portion of the thermostat to figure out, the relative ease of the programming spurred me on to use a MKR 1010 and their ENV board to design a temperature and humidity measuring system that will be the basis of some home automation surrounding my bathroom. I also built on my knowledge of MQTT and have hooked it all up to Home Assistant.

Unity 2D Games

Finally, there was the GameDev.tv Udemy class I took to learn how to create 2D games with Unity. Many websites day y that programmers slid try and learn one new language each year. They each give different reasons for doing so, but I think there are two good reasons. First of all, it helps your brain in the same way that learning a new spoken language helps. It gives you better understanding of your language to see how the new one does things differently or the same. Second, it helps you learn about language that are better in different situations. Each was written to solve a different problem and so what might take 100 lines in one language might be so key to another that it only takes one line. Obviously that’s extreme, there are many niches where certain languages excel like math or AI. This article contains information about a few different “new” languages and what problems they were developed to solve.

This year my two new languages were C++ and C#.  Well, to be perfectly honest, they were not 100% new to me (not like the languages I’d *like* to learn in 2020 – Ruby, Rust, and Go), but I hadn’t touched C# since doing some Mono tutorials a decade ago, when people thought it was going to revolutionize cross-platform development across both Windows and Linux. I have even less experience with C++, but the C++ in the Arduino projects was pretty basic (which goes to prove what I always say – if you can program in one language, you can program in nearly any other).

C# was the language chosen by GameDev.Tv for their Unity 2D development course. It also introduced me to Visual Studio (which I hadn’t looked at for decades) and how much easier it makes programming on Windows. Here are the games I developed this year:

Text101 and Number Wizard: blog post; code for Text101; code for NumberWizard.

Block Destroyer: blog post; code

Laser Defender: blog post; code

Glitch Garden: blog post; code

Tilevania: blog post; code

2020

What will next year hold for me in the programming realm? Well, I’ll definitely be working on my long-running Python projects, like my Extra Life Donation Tracker software. I’ll also be continuing my journey with embedded programming, increasing the amount of C++ I write (and maybe some Circuit Python). I’d like to write my own 2D game in Unity so I’ll continue to work in C# as well. Depending on how much free time that leaves me, I’d like to learn Ruby this year. Yeah, it doesn’t *seem* to be as hot as it has been in the past – I don’t hear as much about Ruby on Rails as I used to. Mostly I hear about Django and Flask and cloud computing projects written in Go. But that might just be an echo chamber I find myself in. From GameDev.Tv, I have both their Unity and Unreal 3D game development courses. *IF* I do any 3D game development courses this year I’ll probably stick to Unity so that I’m only learning one thing (3D game dev instead of 2 things – 3D game dev and another programming language), but if I do get to Unreal – that’s in C++ and I think it would do a lot more for my C++ education than Arduino. Finally, if there’s time (and I’m not sure if there will be), I’d like to take some first steps with Rust and Go. Rust because it seems to be taking over for C in app development since it gives a lot of the same benefits while removing a lot of the attack vectors used by malware. Go because it seems to be becoming the COBOL of the 2010s/2020s.

Github stats

To close things out, some stats from Github for the past year (I wrote this post on Christmas Day, so it’s possible I did some more coding on the weekend between Christmas and New Year’s Day):

  • 769 contributions (contributions are issues, pull requests, and commits in a standalone repo to master branch)
  • 91% of contributions were commits; 5% issues; 4% pull requests

Published by Eric Mesa

To find out a little more about me, see About Me