What is it that programmers actually do?
Imagine the digital world is made of LEGO. Programmers build and connect LEGO blocks (we call them 'functions'), to make apps, websites, and tools.
Each block does something small, like check your "password strength" or "send your email".
Developers decide each day what block to work on next.
Writing code is only a small part of the actual work they do.
You need to think ahead of time what that block will look like, but also how it interacts with any other block, and if that is going to cause issues.
Think of it like building a LEGO castle that has to stay standing while people live in it. You can’t just snap on a new tower without checking the foundation.
Programmers write functions, which you may remember from your math classes. Functions take "inputs" and produce an "output".
A “digital LEGO block” (i.e. a function) returns a result (output), like how cutting an apple “returns” apple slices as a result of your work.
Think of "cutting" as the thing you want your function to do, so you set out to design a knife.
The knife needs an input, like an apple, to work.
And the result, the output, are apple slices.
Functions can be anything. The only limit is your own imagination.
What happens if you use your knife to cut steel though?
You won't get very far. This happens a lot while writing code.
If a function accidentally takes the wrong "input" then it will complain that it can't complete its task.
You get an error message, which we call a bug.
Think of a bug as an unexpected outcome, and it "bugs you".
Let’s say that you want your block to be yellow and in the shape of a rectangle.
Like a button that you click on, but sometimes it changes colour when you click on it.
You get the shape right. But it sometimes randomly changes colour. That would be a bug.
It should only be yellow. And then you investigate why it changes colour sometimes. That process, the debugging process, is part of a programmers job.
Now imagine doing this for tens of thousands of different LEGO blocks! It’s challenging work.
A copy of this article was cross-posted to Medium.
Read comments and reactions →