Introduction

Vetle Økland
Introduction to Programming
3 min readNov 7, 2016

Learning to program has, during the last couple of years, exploded in relevance. Even Obama thinks it is important for everyone to start learning to code. While that is a debate often up to discussion, if everyone will learn how to program, we need languages that everyone will be able to write in.

For our introduction course at Noroff, we have started with Python, a language that is very known for being a good first language. And I have to agree, because at a first glimpse, it is scalable and easy to read. At it’s most basic, it’s just a simple scripting language (e.g. it’s running every line from top of file to the bottom). Then when you go on to learning, you can later add functions and on top of that add classes, inheritation and everything else that comes with object orientation.

Comparing, for example, a Python ‘hello world’ app to a Java one:

# Python
print('Hello, world!')
//Java
public class HelloWorld
{
public static void main(String[] args)
{
System.out.print("Hello, world!");
}
}

As you can see, if you want to teach someone Java, you have two choices, either explain what everything in that code means, or say “I’ll get back to you about this” about every single thing beyond “print” and the string “Hello, world”

The Java example goes for a lot of other programming languages as well, at least those that have been object oriented from the start.

For purely educational reasons, why wouldn’t we learn PHP, Ruby or Perl? These languages can all have a simple ‘hello world’-example.

//PHP
echo "Hello, world!\n"
# Ruby
puts "Hello, world!"
# Perl
print "Hello, world!\n";

PHP is mostly used on the web, so unless you are going to explicitly write web applications, or learn to write web applications, it’s not that well for educational purposes. Both Ruby and Perl can, like Python, be written as object oriented. So why not use any of those two languages?

For one, it comes down to availability. Python is used more in the real world than Ruby and Perl, so learning it is more relevant later if you want to do anything with it. Python also has more publicly available and constantly developed frameworks, as a result of it being used more. This makes Python an easy and world applicable language to learn.

Another point goes to Python for promoting readability. Python uses indentation to define blocks of code. So instead of wrapping a block of code in curly brackets and placing the bracket haphazardly somewhere you see it fit, Python forces indentation. This means no single-line code, and that’s for the better.

Setting up Python was no problem. Windows already came with 2.7, but we’re going for 3.5, so it was just a matter of downloading, installing and pointing PyCharm to the path of the Python 3.5 interpreter. Only thing worth noting about Python.org downloads, is that they default to the 32-bit interpreter for Windows, instead of the 64-bit interpreter. It might, of course, be that Python developers constantly use 32-bit to ensure compliance with older systems, but I would’ve hoped that in 2016, even Windows binaries default to 64-bit.

Personally, I have never coded in Python before, at least not anything beyond a simple ‘hello world’ and running scripts others have written, so I’m very excited to get started. I think Python is going to be very useful to me, as it is used in quite some programs to create plugins or otherwise extend program functionality.

--

--