Code Is Currency

back to index

What is code?

Breaking down logic into two core fundamental questions.

You can read or listen to this chapter


Code is simply a list of instructions, a way to make our electronic devices do things we command, be it an alarm clock to tell the correct time, your car to advise you of your speed or even the computers calculating how our universe began at the CERN hadron collider. I believe code (not coding) boils down to two things, two things that are so fundamentals they have their own chapter in this book, if's and loop's. All developers describe/solve their problems via these two concepts (consciously or subconsciously) and being able to do the same provides you a fundamental understanding and advantage to solving problems in the digital age. Let me share with you a recent example.

It is 12th October 2021 and I am in Abu Dhabi, the capital of the UAE. I am sitting in my friend's dining room looking outside to a cosy 42c heat. I am about to book a flight from Dubai to Colombo, Sri Lanka for the next part of our world travel adventure. I selected the flight time, the seats, picked our meals, entered the payment details and just as I am about to press enter to confirm the booking. I pause and go to a website I created a month earlier ‘wherecanwego.leemallon.com’ (no longer live) to see if we can legally enter Sri Lanka.

The website is no longer active for '‘wherecanwego' but you can watch the youtube video I recorded that explains how the tool works. Best to watch the video after reading the chapter.

Welcome to travel during covid and thinking with a developer mindset.

The FCDO (the UK Foreign, Commonwealth & Development Office) provides amongst many things travel advice. Their website has a list of all countries & territories around the world (around 190). For each country, the FCDO outlines general travel advice for UK citizens, one part of that advice is country entry requirements. This includes applying for a visa or exemptions, and since 2020 has had a new area called Covid restrictions.

We had been visiting the FCDO website a lot since August in the build-up to our world travels, checking where we could visit and what restrictions there were, as countries would change their rules weekly and sometimes daily. The information would explain if what the quarantine requirements were, did you require a vaccine, are certain vaccines not allowed and what other countries you couldn’t visit before arriving. The process was exhausting. An important thing I learned once we left the UK was our travel health insurance was only valid if the FCDO website advised it was ok to visit that country. So if there was a flight between the UAE and Sri Lanka and the UAE said it was fine to visit Sri Lanka, Sri Lanka said it was fine to visit, if every country in the world said it was ok to visit Sri Lanka but the FCDO said no then our travel insurance would be invalid.

Trying to find countries we could visit got difficult and at one point I had one hundred tabs open for different countries, manually finding the covid rules and working out if we could visit. It wasn’t always straightforward to determine the rules either as each country updated their own page so the wording would differ from country to country.

At one point there were only eighteen countries we could visit.

This manual process was tiring and we were getting annoyed checking everyday, one day my wife was checking and in her frustration said: "why do we need to check all these pages".

💡moment

When these moments happen I see if I can break the problem down to code fundamentals which I would like to share with you now, but first a little computer history and why the fundamentals of an if statement and a loop are key for a developer mindset.

Computers are complex yes/no machines, a computer chip is a collection of billions of transistors, and a transistor simply put it has an on or off state representing a 0 or 1. The more transistors you have, the more complex the things you can do, one transistor is a 0 or 1, eight transistors are enough to represent a letter of the alphabet. The earliest computer chips in the late 1950s had sixteen transistors, your iPhone today in 2022 has a microprocessor with fifteen billion transistors. To put this in perspective, your iPhone has 100 million times more compute power than the computer that flew Neil Armstrong to the moon. 100 million times!

Now writing code at the transistor or microprocessor level is very time-consuming and prone to too much human error. Luckily the software industry is seventy-five years old and over that time has been abstracting further away from communicating directly with hardware parts to make working with computer processors easier and more productive. Today software developers have access to many programming languages that enable them to build experiences in hours instead of months or years, each programming language has it's pros and cons as well as a personal preference to your style. Though coding is seen by many a very scientific pursuit artistry plays a major part just like it does for a painter.

Globally the top eleven in no particular order programming languages are Javascript, Python, C#, C++, Ruby, Swift, Go, PHP, Java, Html and Kotlin. These programming languages enable you to create "things" for almost any modern device (web, phones, laptops, Macs, pcs, VR headsets, fridges and even your car’s dashboard) and even with all their marketing and cult-like allegiance, almost all programming languages at their core are the same in that they perform two fundamental operations if's and loop's:

Random fact: It is rumoured that in the early years of the Go programming language that if you searched Google for technical Go questions you would get a prompt to apply for a job at Google as they were looking to hire developers embracing the new language.

The if statement, is simply a logic check, if something happens do something and if it doesn’t happen do something else.

if a = b then c = 5

The loop statement enables repetition, do something a number of times.

do x 5 times

If you can break down a problem into an if and/or loop you can represent it in code. Using this principle I had an idea that could make searching the FCDO website for covid restrictions much easier.

There is a page on the FCDO website that lists all of the 192 countries and territories. Each country then has it's own page it is linked too which contains amongst other things the current Covid entry requirements. It would be possible to loop through the 192 links to get each country’s page. Then for each of the pages search the entry requirement section to see if terms such as "vaccine", "no travel", "quarantine", and "red list" existed. Those matching the specified terms would be ok and those that did not were blocked and I could have a filtered list of places we could visit.

So breaking this down in this way meant I know I could represent it in code so this is what I created. I wrote a piece of code that every hour would access the FCDO website, get the 192 countries listed, and loop through each of them to access each country's web page. My code would then search the content of the page to see if these key phrases were a match and if so write that country name on a page and if the country was ok to visit, set the text colour to green and if not red. I could then quickly look at the green countries to see where we could visit next. I also understood others maybe having the same travel issue so I put a link to the tool on my website that anyone could use. For the 3 months the tool was active it cost me $0.02 to operate.

Now this was a fairly straightforward tool to build and problem to solve, but it was made simple because I broke it down into the two core principles of if's and loop's. Now you know this, I would ask you to try it, take the same if's and loop's logic to a problem you want to solve however small and see how it holds up.

In the next sectionwe will take these core concepts and show how they are used in the tools and services you use everyday and unlock new functionality you possibly never knew existed.

If you decided you wanted to learn some code or someone asks you what they should learn to be best prepared for the future I would recommend Javascript and C# or Javascript and Python. Having these two skills means there is no device/platform you can’t build for.

back to index

Want to get new chapters as they are released?
Subscribe to the weekly email or the audio podcast version.