First Things First: Why Python Should Be The First Language You Learn

Let’s Get Ready to Code

It’s that time. You’ve decided that you are finally gonna bite the bullet and take up programming. You’ve perused some forums, you’ve watched a YouTube video or two, and you’ve probably watched The Matrix (or The Social Network). For good measure, you probably checked out my write-up on different coding definitions. You head over to Google and type in “One programming language, please” and then it happens – you’re bombarded. Dozens of languages vying for your attention, each one eagerly pleading “Try me! Try me!” Which do you choose?

There is no correct answer.

Except there is. And the answer is Python.

 

Why Python?

 

The answer is Python

I’ll admit as I type this that I’m a bit rusty with Python. It’s been a few weeks since I’ve sat down and banged out some code in Python, but it’s been a lot longer since I’ve actually sat down and tooled around with it. Python will forever hold a place in my heart, as it was the first programming language that I learned (so yes, I am a little biased).

Why should you make it your first language? Because it’s simple and it is deep.

Python was created in the 1980s and it’s most recent iteration (Python 3) was released back in 2008. The makers of Python (named in part after the Monty Python films) set out to make a language where you didn’t have to sacrifice simplicity for function, and Python is brimming with that feeling. Python takes some very complex and intricate ideas, and even some that require lines of code in other languages, and shortens them and cuts the fat out of the work.

What Python does that other languages do not is that it opts to make indentation a staple of its coding blocks. I’ll explain:

In coding there are an unwritten set of rules called “conventions”, sort of like guidelines that everyone agrees are smart to follow even if not entirely necessary. Over time you’ll learn about things like naming conventions and commenting conventions, but one of the big “style conventions” of programming is to indent your code to make it legible. The idea is that reading code that looks like this:

 

Here is my code and it is gonna do stuff such as;

Create Lists of things like;

Ideas and names and dogs;

And cats and clouds and pickles;

Do math and calculate stuff like;

My paycheck and the amount of words on this page;

Counting hours spent on the computer;

 

Is a lot harder than reading code that looks like this:

 

Here is my code and it is gonna do stuff such as;

Create Lists of things like;

Ideas and names and dogs;

And cats and clouds and pickles;

Do math and calculate stuff like;

My paycheck and the amount of words on this page;

Counting hours spent on the computer;

 

Now without having dove into coding yourself just yet you may insist that the first example was way easier to read, but imagine having a thousand line program where it is not easy to discern what areas belong to what. While the second example may look a little loopy, notice how I used my indentation to sort of “group” stuff underneath the area that it applied to. This is one of the style conventions with coding – to use indentation to group ideas and functions underneath the areas that they apply to. It makes it vastly easier to pinpoint one spot in the code visually if you are able to see that the code is broken down into pseudo-sections.

You are killing two birds with one stone

Now keep in mind, this is a guideline, it’s not technically required (especially if you don’t want to have a job in the industry!), so the code will generally work just as well without the indentation as it will with it. Most programming languages use other tools, like brackets and braces, to help further group code chunks together so that the computer can make sense of what we are asking it to do. This is where Python differs – instead of using brackets and braces and letting indentation be optional, it forgoes using the other tools and makes use of the indentation (referred to as “significant whitespace”). You are essentially killing two birds with one stone: you are making your code more readable to humans and also making it acceptable by Python’s standards.

 

 

I’ll never forget moving on from Python to Java and the culture shock I got at how much extra punctuation is required in comparison. Not to say that it is a bad thing, but rather to say that as a novice coder, the punctuation was just one less thing I had to worry about with Python. The Python IDE is also a cinch to use and doesn’t require the creation of packages and projects to get up and running, which was also much appreciated in my early programming weeks.

These changes don’t result in Python being less feature-rich however. Remember, it’s about cutting out the fat, not cutting out the function. Python functions as a perfect wading pool for those looking to dip their feet into the world of programming, because you will find all of the features that are in any other high-level language while also finding that Python makes the road from A to B as short as possible.

I’m going to detail how to get started with Python in another post (as well as how to get started with some other languages) but I implore you to research what exactly you want to do with coding and inform your decision of which language to start with off of that. I recommend Python because it was a great educational tool for me, and I’d love for it to serve you in the same regard, but at the end of the day it comes down to what you want to do as a programmer.

Maybe you want to make the next YouTube. Or perhaps you want to code the next BitTorrent. Find the language that will get the job done and immerse yourself in it. You might land on Java, or C++, or C#, or any number of languages, and I hope I can be here in some capacity to help you with wherever your programming path takes you, even if it’s away from the warm embrace of Python.

 

Oh, and about YouTube and BitTorrent? Both products of Python.

 

Nick

I am a twenty-something coder in training, amateur weightlifter, and newly minted website owner. Aside from coding and lifting, my other hobbies include writing, drawing, reading, and the occasional video game. I live in the ever-wonderful Los Angeles, California where I was born and raised.

One thought on “First Things First: Why Python Should Be The First Language You Learn

Leave a Reply

%d bloggers like this: