Andrew Hosgood

OO PHP Web Developer specialising in User Interface Design and User Experience

The Importance of Messing Around

24th July 2013

As a developer, I am expected to make things that work. As a UI designer, I'm expected to make things that look good. Working for Logo, I have to try and balance both.

I am a massive geek – no question. When I'm not at work (coding) many of my hobbies include coding, looking at code, fiddling, tinkering and playing with code and just generally trying to express everything I can in some form of new or existing computational syntax. The difference between geeks and nerds is a topic for another discussion, but let us just say for now that I do enjoy my coding.

I was recently tasked with creating a new internal management system to help the developers keep track of the plethora of servers, mounts and shares, domains, databases and SSL certificates that we have to keep an eye on. The system (aptly named Mission Control) is only going to be used internally which gave me a great opportunity which every web developer dreams of: I get to code for modern browsers. If you are a web developer or designer then you can really appreciate how rare this is!

With everyone in Logo Design using Macs (or at least Chrome and Firefox), the prospect of not having to support IE in any of its hideous renditions with its diabolical support for anything that developers would refer to as "cool" filled me with a little bit of excitement. It gave me a chance to make full use of CSS3 selectors, animations, HTML5 form validation, SVGs, the canvas element, CSS gradients, rounded corners, and all the other semantic improvements that come with HTML5 without the use for plugins and workarounds.

The only real specification I was given was:

"Don't make it complicated else people just won't use it"

Well, duh! But returning to the main point of this article, I was so excited by the prospect of using decent code that I started putting in extra hours after work to build it, fiddling with a whole host of languages: PHP, HTML, JavaScript, CSS, SQL, XML and Python.

The prototype and first version of Mission Control took some time to come together. I wanted to develop it at home but even though I have a good 50Mb cable there, here at the Engine House (situated in one of the prettiest estates in the most picturesque part of the country) we have six ADSL connections and developing remotely becomes a bit of a pain. Several months ago I did what every REAL geek in the last year has done and bought a Raspberry Pi (well, I actually bought three) and installed Apache, MySQL and PHP on the standard Raspbian OS. [Side note: if you are geek and you haven't bought a Pi - shame on you!] This allowed me to take home an actual server. Not an all-out Godzilla, but more of a £35 Puff the Magic Dragon good enough for a small gaggle of developers to develop websites on and cheap enough to break without too much worry. I knew a modest amount about administering a Linux server from a combination of past jobs and breaking (chmod -fR 777 /*) some of my own older computers. Having the Pi to develop Mission Control on has now given me more confidence when I have to poke around with (and hopefully fix) some of our larger servers. Even though our CTO handles 99% of the server administration, it's now good to know that I can fix some of the simpler problems if he is at McDonalds for lunch.

Before this project, I didn't actually know Python. I knew it was a very simple language but I had never had the time to look into it. It was one of those things that I kept saying "Yeah, I'll learn it when I have the time…" when the time never seemed to come. One of the things that I wanted Mission Control to do was to run a cron every hour to check if any of our servers had collapsed into a smouldering heap as well as checking all the domains to see if they were all still pointing in the right direction. I decided that Python was the best solution for this so I sat down one evening near the start of the project with a meal from our local Chinese (which is the second best I have ever visited) and learnt Python. One evening; that was it. I was quite astounded. There were no distractions, no clients, a server built to my own requirements and only a hint of a specification.

Something else I have been able to do over the past few weeks was further improve my JavaScript skills. I have written literally hundreds of thousands of lines of JavaScript in my life (Dan and I once made a calculator to work out the number of characters and lines of each language for all of our projects – geeks!) and I didn't think there could have been much more to learn. Nevertheless, with fewer restrictions I was able to re-think my approach in several key areas. I was able to optimise my Shadow JS script within an inch of its life and I took the chance to rework some of my other plugins. I was able to completely recode our Shadow AJAX JavaScript class (something which I didn't think could be made any better!) and I even managed to improve the JavaScript debugger to sit on top of our framework. All of this helped make Mission Control really (really) quick and because I learnt some new techniques, I was able to write the JavaScript in such a way so that we can integrate it easier into future projects.

I looked into Shadow DOM (nothing at all to do with our Shadow, just an unfortunate naming coincidence) and even though I didn't use it for this project, I have a firmer understanding of it for when (and if) we need to use it in the future. This had been sitting in my "To look at" pile for some months now and it was good to finally research it.

To a lesser extent, I also brushed up on my OO-PHP and SQL as well as prodding PHP namespaces quite hard to try and see what unfamiliar goo would ooze forth.

In essence, messing around with all of this whilst building our web app (a term that I am still annoyed with Steve Jobs for introducing) has given me a greater appreciation and knowledge for the many different styles and syntaxes of code. I have added to my list of known languages and improved some of those already on my list as well as increasing my confidence with administering Linux servers.

So go and play. Mess around. Poke. Tinker. Break. Cry. Reformat. Improve. Fiddle. Smile. Poke again. Fix. Share. Conquer. But most of all, have fun. If you don't have the time, make the time — it's good to learn.