Being Hungry
We recently hired a developer to create some new web applications but also to maintain our main legacy web application. As a consequence, I had to revisit code that I had written at least 5+ years ago. Many of us have had that experience of revisiting something we created many moons ago and we expect to be horrified.
And I was. But there was this other feeling. As a reference point, here is the code am referring to (Fair warning: It’s long, but that’s kind of the point)
Yikes. This code breaks pretty much every principle around. And yet, as horrible as this code is, I cant help but feel a sense of pride.
When I wrote this code, I had just started at my current job as an IT Intern. My first task? Create an online training platform for onboarding new employees. As you can expect, I had no business doing that. But I was young and a bit naive. So, I accepted without thinking twice.
Get Cully Mason’s stories in your inbox
Join Medium for free to get updates from this writer.
Boss’ orders: It had to be built on top of our current stack which was built on an already outdated version of Yii, which ran on a 4.* version of PHP. I sighed as there was this new hotness called Laravel, that I was certain would cut my development time in half. Regardless, without too much of a fight, I accepted the task.
One of the tent pole features of this training application was there would be various ways verify an employee had completed a section of training and that each section had an interface to build that verification. (IE build a quiz, upload a file)
So I started building with the most advanced tool I had in my toolbelt, jQuery. After writing a few dozen lines of javascript, it had already become unruly. There had to be a better way. Then I found backbone.js. The idea of having models and views directly in the JS code was mindblowing to me. But soon I outgrew that as I wished I could define model relationships. Then I found Marionette.js which was the first time I had been introduced to the idea that you could build an entire front end app.
Then I found Ember.js (I believe this was around version 0.3?) and I’ll never forget that feeling. Everything just kind of made sense. It was extremely opinionated (which I now truly appreciate) and a bit buggy.
Enough down memory lane, my point was that I was an intern that had been given an impossible task. I had never really worked with a php framework outside of cakephp. Front end frameworks were just becoming a thing. I didnt know what JSON was. Building a RESTful API was a completely new concept to me (Yii didnt even have support for anything other than a POST and GET request). I had no experience with CSS (Thank goodness for Bootstrap).
Yet, in the end — it worked. Yes, the code wasn’t the best but at the time it was my best. In fact, it was better than anything I thought I was capable of creating. That is a feeling, that is second to none. I try to keep that in mind when I am writing code but also when I am reviewing what something else is doing.







