More beginning programmers try Python

We are big fans of the Python programming language and use it as a starting point for our students.  They try Python on their first day alongside Scratch!  We decided to use Python after extensive research and it looks like more people are coming to the same conclusion.  Python is the language whose popularity has grown the fastest over the last five-years according to the recently published Popularity of Programming Language index.  The PYPL index analyzes how often programming language tutorials are searched on Google.  Python came out on top over five years as well as being the second most popular in the US.  Check out the five-year graph!

Python has a readability that new programmers can “get” pretty quickly.  Here is a great example from a side-by-side comparison of Python & Java.  Which do you more easily understand?

Java

Public class HelloWorld

{

      public static void main (String[] args)

      {

               System.out.println(“Hello, world!”);

      }

}

Python

print(“Hello, world!”)

With Python we can also avoid unnecessarily confusing the students with Object Oriented Programming (OOP) concepts.  There is plenty of time for OOP later when we show them Java (in the wonderful Greenfoot environment).  But to start it is more important to see code that runs more logically top to bottom. Then we can add things like while loops and functions so they can see the code begin to jump around.  This way the students will focus on problems and solutions instead of architecture, as noted in the James Hague blog entry below. (Yes, we know Python is an object-oriented language but we can avoid the OO features and instead stay procedural.)

The bottom line is that we want our students to be able to change the code.  We want them to get their hands dirty, try things, and make mistakes.  There is a greater chance that they will enjoy programming while learning the material.  Looking at the code examples above, would you be comfortable changing any of the Java code?  We have nothing against Java and love Greenfoot.  We just don’t throw them in the deep end of the pool with Java until they have some hands-on time with Python to develop more confidence and experience.

For further reading, see “Don’t Distract New Programmers with OOP” and “Python & Java: A Side-by-Side Comparison”.