How to learn the basics of programming

mbvissers.eth
5 min readMay 27, 2019

Programming is this huge thing right now. We all use electronics and most of them run software one way or another. You mobile phone is 100% useless without software. Your laptop or computer are so incredibly useful because of the software they run. Most traffic lights run software, your new car runs software and even your grandma’s phone probably runs software.

Image from unsplash.com

You probably know how much software we use in our daily lives. And someone has to write it. Next year (2020) in The Netherlands we will have an estimated shortage of about 55.000 software developers. This means that the wages go up and that you can find a job a lot easier than you would in other fields. And the fact is, you do not need a college education to find a job. A senior programmer in the company I currently work for is educated in music. He home schooled himself in software development because he couldn’t find a job. He now knows probably more than me and I just came out of a 3 year school for web development. A lower level than a bachelor but still it’s impressive how much you can learn at home and how far you can come.

So how would such a person start learning to develop software? There are tons of ways and each year there are coming new and better ways to start learning software development. A way that my school used to teach the basics of programming is by doing a few courses on Codecademy.com‎ . This website has a few free courses that assume you know nothing about programming. I started with HTML, CSS and JavaScript. And for my Bachelor study it is recommended to do the Python course. I will explain a few things in this post to prepare you for your Codecademy course.

Aside from Codecademy there are more ways to learn programming. Udemy has a few great courses on specific fields of software development. From app development to machine learning. But those aren’t the only ways to learn the basics of programming, there are much more. If you want to find them all you should just google what you want to learn and I’m sure that there are more possibilities than you would’ve ever imagined.

How to program

First off, I’m not a teacher. But I will do the best I can. I do however have over 4 years of programming experience in a few different programming languages. I will not use a particular language in the code below. This is called “Pseudo-code”.

Image from unsplash.com

Programming might seem scary at first. Weird obfuscated lines of code that you see in the background of a news story on software or hackers with green terminals doing whatever but that is not what programming is (sorry). Programming used to be very hard and it used to take hours to just learn how to print “Hello, world!” on the screen but now you can learn it in a few minutes, and the code sometimes reads like a weird kind of English.

For example, if you want to print “Hello, world!” on the screen you would simply write:

print(“Hello World!”)

in most programming languages. And of course this will mean “Print the string “Hello World!” on the screen”. This was an easy one, but it really is the first program you are going to write, whatever course you do. In whatever language you choose.

After that you would probably learn about variables. This is mostly explained using you name and an application that would greet you.

var name = “your name”
print(“Good morning, “ + name)

This might seem a bit harder at first. But read it like its English. The variable called “name” will contain “your name”, and after that (next-line) print “Good morning, “ With our name after that string. This will print “Good morning, your name”.

But what if the name isn’t entered? Or what if it isn’t morning? That is when we use so called ifs or if statements. Or even more advanced, if else or even if elseif else statements. I will keep it simple for now and start with the if and else statements.

var name = “”
if(name == “”){
print(“Howdy there, stranger!”)
} else {
print(“Hello there, “ + name)
}

This looks scary right? But it isn’t. In the second line of code you can see a comparison between the brackets. It will check if name is equal to an empty string. So, in English: If the variable name is equal to an empty string, print “howdy, stranger” else (if the variable is not an empty string), greet them with their given name.

An elseif statement is nothing more than a extra way of checking. Some languages have also implemented a so called Switch statement for more or less the same use case. Here is a small example, but I won’t go into to much detail.

var number = 5
if(number > 0){
print(“Number is positive”)
} else if(number < 0) {
print(“Number is negative”)
} else {
print(“Number is zero”)
}

Not every question has two answers. You can have as many elseif’s as you want in most languages, but be wary! The order matters. If you want to check how many letters a string of text has you need to start at the biggest number and go down smaller each time, like so:

var coolString = “AOA”
if(coolString.length > 10){
print(“A big string”)
} elseif(coolString.length > 5) {
print(“Still a big string”)
} else {
print(“A small string”)
}

If the string doesn't have more than 10 letters it will go to the next elseif, if it also doesn't have more than 5 characters it goes on to the else and say that the string is small.

With only this knowledge it is already possible to write a working Rock, paper, scissors game. Go ahead and try it, You have two variables, one for each player. You might have a third variable for the result and you would have a few if’s (maybe even nested if. Meaning and if within an if statement).

Once you have done that without touching a course on Codecademy you are already ahead of some since this is the first thing you learn in a few of those courses. But I will advise you to go and learn more about coding and programming.

If you have a specific language you would like to learn or a specific field you want to educate yourself in you can start looking for courses specifically for that field. Basic web development is relatively easy to learn and won’t get very hard until later on. App development has a bit of a learning curve but can be really cool to learn because you can run your apps on your own phone.

Have a lot of fun learning because there will always be something new to learn.

--

--

mbvissers.eth

I occasionally write about programming. Follow me on Twitter @0xmbvissers