Why learning to code feels like having superpowers

Why learning to code feels like having superpowers, and why I love free/libre software and open source code

Originally posted in Spanish on May 27th 2015

I have always loved coding: it is a world based on maths and physics, where logic allows you to understand causes and consequences. I already had several software geeks among my favourite characters on the comic books I read as a teenager. Of course, they were secundary or tertiary characters like X-men’s Sage or Planetary’s The Drummer. Their main skill was the ability to understand how thinks work, so they were able to see things that were hidden on plain sight for the rest of the world. What I could not guess was that in the future, by studying computer science, I would also feel as if I had that kind superpower.

The so called computer revolution started over the 90s, but nowdays computer science is tangled in our personal life with the “Smart Technology”: we have SmartPhones, SmartBands, SmartGlass, SmartWatches… The Quantified Self, or meassuring our daily information, like pulse, calories, expenses, web positioning leading to have a huge ammount of information about anyone of. The big question is: do you know how that data is handled? That is the skill you get by learning how to code: you may read the source and discover what it does and how it does it. The best thing is that you will be able to make informed and responsible decisions, and the worst is that your friends may look at you as you are some weirdo when they ask you why you do not use a certain app and you answer them: “I have seen the code… AND IT IS HORRIBLE!”.

Therefore, you may be able to edit that code and improve it. You may adapt the system to suit your taste in design, or make it more efficient and safe, like preventing it from sharing some of your data which you may not want anyone else to have. You may even repair it when you have some problems. It is great to be able to create new systems which handle a lot of information for you, so you do not have to spend a lot of time in tedious work. You may be able to spend your time on other matters or manage more information with less effort. This train of thought will lead you to love the free/libre software and open source movements, which will provide you access to the code for free. Some days you may feel like a Shadowrun character in its endless fight against megacorps, but it is worth it.

  • So, why is learning how to code so interesting?

Sometimes you may access to the source, audit it, or even play with it. In other cases, the software patents may prevent you from learning how it works, and that may lead you to all kinds of absurd situations. One example of that are “smart home appliances”. There are washing machines may connect to you home wifi to send a notification to your phone saying that their program is about to be completed. There are also fridges which detect that you do not have enough eggs, and may request to the nearest grocery to send a dozen to you home. The need of these systems may be arguable: my favourite ridiciulous “smart” object is a food dispenser for cats which opens the recipient when you send a tweet with a mention to its Twitter account, and yes, it that thing existed on 2011.

Now imagine that the system is poorly programmed and has “Russian roulette code” like this:

1
2
3
4
5
6
7
8
int min = 1;
int max= 6;
int value = (Math.random()*(max-min))+min;
if (value == min){
die();
}else{
//your code goes here
}

This is a very simple case which simulates throwing a 6-sided dice. The computer do not have tha ability to generate a random value, so they usually rely on the latest digits of the internal clock time to generate the random result. Hence, if you get a number between 2 and 6, everything will work as expected, but if you get a 1 the system will crash and die. This may lead in a silly way to planned obsolescence in its worst definition: if we went back to the smart fridge I mentioned before, it may be buying tomatos until judgement day, which may really hurt your wallet. Fixing it would be as simple as removing the whole if clause surrounding the “your code goes here” line, making it more efficient (you would be running 7 lines of code less) and security, but if this were privative code you would not be able to (or more like you should not) do it.

This kind of situation is a setback, or sometimes it could be part of a twisted business model to damage your right to repair. That is the reason why I will always prefer a system which lets me see what is happening under the hood. People can review it and improve it, making it better for everyone. This does not mean that their creators should lose all control over their work: there are different licenses, similar to creative commons, which can be properly adapted to each business model, allowing you to handle the different rights. You should always keep the authorship and moral rights, and you may (or may not) restrict economic remuneration and derivative works by choosing the model which fits you better. Making a modification does not mean doing something ill intentioned, it may solve a dangerous issue and avoid many future problems.