In many social situations, such as parties or at the doctors, it's customary for people to ask one other what they do for a living. When people ask me, I give the standard answer of "I'm a developer". This usually then leads to four different conversations;

  1. "Oh that's neat… Excuse me, I've left a turkey in the oven."
  2. "Oh cool! Hey, I've got [insert item of tech here]. What do you think? What should I buy next?"
  3. "Oh cool! Is that like the Binary thing? Like that film? The Matrix was it?"
  4. Mythical: "Oh yeah me too!"

The first instance I can't do much about. Some people are dicks. Sorry for breaking that to you.

The second point can range from being flattering, to downright annoying. I've been to parties (shut up, it happens) with people who ask constant questions and opinions on a laptop et al. Quite frankly if you're just going to be surfing the internet and receiving emails, then get what's cheapest… Or get that Mac you've just been on about for 20 minutes. Whatever. Case closed.

The fourth point does occur, and when it does it's a nice surprise, until we both mutually realise we're both as socially awkward as each other (Joking… That's only happened, like, 3 times).

The third point is the reason for this blog post. I'm going to attempt to explain what I believe code is, and what it means to me, without actually getting into writing code.

Class 101

Let's start with exactly what code is. Below is an example of a "Hello Word" in a language called Java*. This, usually, is what every programmer writes as their first test of a language. It's just standard, and there's probably a long history about it or something.

Hello world java

Anyway, first thing you'll notice is that IT'S IN ENGLISH! Not binary. Most programmers know binary, it's like an unwritten law. I've never needed while actually programming however.

Programming is effectively using a standard set of commands, and rearranging them and linking them together to form an overall output, such as a website or phone app. Programming languages are exactly what they are on the tin (???); they are languages. They have their own style, syntax, and concepts, just like English or Elvish. But, for the most part, they all achieve the same thing - communication!

You can write "Hello World" in almost any language, but how you do it can be entirely different. Take a look at this PHP:

Hello World php

Same result, but different syntax/style! Just like in traditional written languages. English for hello "Hello", while Spanish is "Hola" and Hawaiian is "Aloha". Same goal, different words.

It's a little like plumbing

So we now know computer code is a form of language, that's for the most part written in English, and different programming languages are formed of different syntax and styles but ultimately can achieve the same result.

Ok, onto the structure of code. Think of code as the plumbing in your house; there are different components working together to get water to and from your house. There are many different parts, and they are all connected together. Some parts are used when you turn the upstairs tap on, while others are used while showering, and so on. Some of these parts are specialised, other parts are duplicates such as bends etc.

It's all about knowing which part to use when and where. This is the same with programming. When do I use this bit, to achieve this output? And what can I do with this output, to continue to get something else that's more useful?

So how do different languages fall into this? Imaging different pipe material. They all achieve the same goal - moving one liquid to another spot - but are made out of different materials.

Actually, it's a bit like a waltz

Still with me? Hope so!

Here's where things get really complicated. Many people believe (and I am one of these people), that there is such a thing as elegant programming. This is different to efficiency. Efficient programming is akin to using the least number of pipes in your house that traverse the shortest distance. While good in theory, this leads your house to having ugly pipes exposed and nowhere to put your My Little Pony collection.

Elegant programming however is the idea that what you've made is easy to understand, obvious, clever, and easy to expand and maintain. It's a bit strange when you say obvious and clever in the same statement, but it's a thing. Promise.

This is where the concept of music comes in. Take a look at Twinkle Twinkle Little Star. It doesn't consist of many notes, and if you play it on a recorder, it sounds pretty basic and simple. But give the same tune to a master on, say a guitar, they could turn the very simple tune into a song that could easily be used to serenade couples down a boulevard. The concept of something being clever, yet obvious!

Music is the closest I can come to explaining exactly what code is. Music can be written down, and shared, but each musician can put their own twists on it. They can also change the instruments. Add more in. Take some out. It's a mixture of maths and soul. Logic and heart. And that's exactly what programming can be. You can build a huge system that all works together to produce a product (an orchestra playing a symphony), or a tiny program that does one thing but well (guitar busker).

This concept is something that I love about my work. It's something that gets me programming during my weekends, and gets me pumped when I have a new idea. This concept of building something that produces a useful product, but is elegant and beautiful in its own right. Even if no one but me sees it.

Anyway, I hope you enjoyed my introduction into what programming is. That's all for this week folks!

*Related to that constant pop up on your computer asking to update. The other one to Adobe Flash.