The programmer puzzle: What is programming?

José 'Joshi' Ráez Rodríguez
6 min readSep 16, 2017

--

Programming is hard. That’s the complain I hear the most whenever I talk with other programming students, technicians or engineers, or while giving private lessons. Whether trying to understand memory, data structures, or just why you need a variable; people struggle.

But I think that this shouldn’t be the case. Programming is not inherently hard: it can get really complex, but not at the entry level. The issue I think lays in what we teach as programming. We teach coding, but we don’t teach what programming actually is.

This is sometimes known as understanding the programming paradigm, What a word! For the sake of simplicity I say it could be aproximated as the cause and the method. The why and the how. And that is what I’ll try to explain.

We teach coding, but we don’t teach what programming actually is.

“What is programming?” Would you ask. And I do ask this too to my students. I have heard a lot of answers: developing programs, solving problems, making utilities… yeah, all of those are programming, but they don’t go to the core of the question.

Programming is transforming data.

Have a design, and sizes, and you can program a visual interface. Know what a customer likes and you can give him custom adds. Ask for some numbers and a operation and you can give the result. Our work is to transform data into something useful. This is our cause.

A sentence and a few words and numbers and we could get this in our screens.

But now… how we do it? How can we transform numbers into graphics? Subjective data like customer likes into “choices” that give us the perfect custom add? This is hard. No. It’s not hard, it’s complex. Remember…

Programming is transforming data.

… and it is so, always.

Let’s get to the how then. How do we do this? I’ll start with a basic example: a calculator.

It has return, the ever dreaded beginner programming project.

A calculator is something that makes operations for you. If we put it in more technical terms, it will be a program that will show data (answer) given the user input (problem).

Let’s forget that and go step by step. We will start with an addition calculator. What does it do?

  • It gets two numbers.
  • It adds them.
  • It shows the user the result.

This is our program. And it should be so in any language or framework. Now we can solve them one by one. But most important: these problems are far easier than the problem before. We can even make another program for each one of these if it’s needed, and in each step, these problems will be even easier. For example, our first step could be:

  • It gets one number.
  • It saves the first number.
  • It gets another number.
  • It saves the second number.

Now we have lots of pieces, little problems of easy solution. How do we connect them?

Our work is to transform data into something useful.

We just transform every tiny bit of data into another tiny bit that is useful for us. And we know what we need because we know what pieces we have. We assemble the pieces, the puzzle.

  • The user press a button, we get a number. We save it.
  • We do this again. We now have two numbers.
  • We use these two pieces of data and add them. Now we have a new number: the result.
  • We send this number from “our program” to the screen.

In each step from some info we get new info. We use this new info to go forward into the next step to get new info. We do this until we reach our needs.

But the magic doesn’t stop here. Now we have a program that sums numbers. That makes a transformation. We can use it for other things! For example: imagine you have to make a program that calculates the total income from a shop. You need to do it in the Excel or Google sheet where the store’s owner saves the sales benefits. It again sounds complicated. But we can go step by step again:

  • We get one sale from the excel. Save it in our program.
  • Get the next sale from the excel. Save it in our program.
  • Sum those numbers. Save them in the program.
  • Get the next number, sum again and save. Repeat with all the sales.
  • Write the end number in the excel.

Is our calculator again! Just that we now repeat the program over and over. But for very different words, very different cases, when you go step by step it becomes very similar. What’s more, you can use your old program again and save some time!

This is our how. We transform the data for OUR needs, step by step, until we reach our solution.

For very different words, very different cases, when you go step by step it becomes very similar.

This is the programmer’s puzzle, the programmer’s paradigma. Learning what do we do: transform data. And how we can use it: to transform into useful data for us, which we can then transform again.

This is what I try to teach my students. When they start seeing the path the data follows from one point to another, they start trying to fit pieces in them until they complete the puzzle. Now they know what they are looking for when they code.

If you see the picture, you can try to fit the pieces

Clossing statements:

  • The “hard” part of the methodology is being able to predict or identify the pieces you need. This is what you learn in college/university in theory classes, and you can learn it also from your experience and research. There are ways to speed the process and have some sort of methodology even for the most complex cases. These topics will be discussed in future entries.
  • While in one hand programming can be somewhat simplified, software engineering IS hard, but not because of programming, but because of the decisions we have to make. One solution can solve a problem and not be optimal for the situation at hand. Knowing when to use which resources, why and how is critical in the process to be a good programmer and engineer, but is not something that an entry level should worry about. Furthermore, knowing this is, in my opinion, the most critical point to become a senior engineer and further. But only then.

Thank you very much for reading it! This is my first post at Medium. I hope you liked it. I was unsure about making this post because of my little experience, but I thought that every one has a first time and I finally got the guts to do it. Also, I have had this topic on top of me for months, and I think it is a very interesting one to share.

What do you think? Have any insights in how you teach programming or what problems can arise while teaching it? Have any criticism or suggestion which could be of use for this or future entries? Please leave a comment! You can find me too in Linkedin (http://joseraez.com), Twitter and Github (@JoshiRaez). Thank you very much for your attention. Read you soon! :)

--

--

José 'Joshi' Ráez Rodríguez

(Trying to be a) Software crafter, T shaped knowledge. Any technology is a tool to be used in the right circumstances. Our power lies in our decisions.