Most people perceive programming as something that requires a lot of smarts. You've probably seen movies with some aspergers guy sitting bent over a computer typing magic code while avoiding all human contact. The high salaries of most programmers help proliferate this idea: It's easy to draw the conclusion that only people with crazy wizard knowledge would get those salaries.

Now, this blog post is an attempt at making people understand how mind-numbingly easy it is to get into programming. But before that, a little history lesson is required. See, programming hasn't changed a lot since the 80's, so in order to understand why programming works the way that it does, we have jump into the hot tub time machine for a second:

Back in the day, computers didn't have fancy video displays. The output of computer programs was printed on long pieces of paper. Computers also didn't have the capacity to show images - only text was possible.

Now, for the fun part. We're going to play a game. I'll show you a piece of code, and given what I told you, will have to guess what it does. If you're right, I'll send you a bitcoin. (I won't, but stay motivated)

Here we go. Question 1, what does this piece of code produce?

----------------------------------------------------------------------------------------------------------------

print 2 + 2

----------------------------------------------------------------------------------------------------------------

Now, think about it for a second (literally), and read on. I'm going to go ahead and pull the good old "Dora the Explorer" trick and say: "Yay, good job, the correct answer is really 4".

Okay, Now Question 2:

----------------------------------------------------------------------------------------------------------------

print "Hey man, 2 + 2 is obviously " + 2 + 2

----------------------------------------------------------------------------------------------------------------

The answer is "Hey man, 2 + 2 is obviously 4". (See everything inside the quotes is just printed out as-is, the first calculation of 2+2 is not performed.

Question 3:

----------------------------------------------------------------------------------------------------------------

x = 2 + 2

print "Hey man, 2 + 2 is obviously " + x

----------------------------------------------------------------------------------------------------------------

The answer is "Hey man, 2 + 2 is obviously 4" again. See, x is a variable, and in the first line, x is calculated. In the second line, it is printed.

Now, let's get fancy:

----------------------------------------------------------------------------------------------------------------

x = 2 + 2

if x > 2

   print "Hey man, x is bigger than 2"

else

   print "Hey man, x is not bigger than 2"

end

----------------------------------------------------------------------------------------------------------------

The answer is "Hey man, x is bigger than 2". That's because x is 4, and so the conditional "x > 2" is true, and only the first clause is printed, but no the second one.

Now, there is obviously more to learn about programming than this. But I hope that this little quiz has given you hope that maybe programming is not really that magical - good code is actually self-explanatory. One of the things I've learned when building my first company was that it's extremely valuable to write code that non-programmers can read.

Oh, and by the way: The programming language we've been playing with is called ruby, and it's pretty awesome. This comes from a guy who has experience with most programming languages out there.

More from Indie Hackers: