Why Python?

in Development

You may have heard that Python is gaining in popularity, but did you know it’s now the most popular introductory teaching language in U.S. universities? And it’s the fourth most popular language according to an IEEE survey, behind old classics Java, C, and C++?  So in celebration of our two new Python courses — Try Python and Flying Through Python — and the launch of our new Python technology Path, I wanted to delve into why Python is useful to learn, and showcase a few companies who use it.
Python is easy to use, powerful, and versatile, making it a great choice for beginners and experts alike. Python’s readability makes it a great first programming language — it allows you to think like a programmer and not waste time understanding the mysterious syntax that other programming languages can require. For instance, look at the following code to print “hello world” in Java and Python.

Java

public class Main {
  public static void main(String[] args) {
     System.out.println("hello world");
   }
}

Python

print(hello world)

Minimal setup is another of Python’s perks. If you’re on a Mac, just open the Terminal program, type “python”, and press enter.  

If it’s installed, you’ll see the version (mine is Python 2.7.10) and the Python interpreter will start. Then you can easily write your first Python statement: print(‘Hello World!’)

And now you’ve run your first Python program as easy as that! If Python isn’t installed, it’s easy to download and install. Instead of focusing on how to get your code to even run, you’ll be able to focus on learning actual programming concepts. And once you have those tools under your belt, if you move on to other languages, you’ll be able to easily understand a given piece of code.

But don’t think that because Python is easy to use it’s a wimpy language. Python is incredibly powerful — there’s a reason companies like Google, Dropbox, Spotify, and Netflix use it.   

The Dropbox desktop client is written entirely in Python, which speaks to its cross-platform compatibility. Dropbox has about 400 million users and considering it isn’t bundled with any operating system distribution, that’s a lot of users downloading and installing Dropbox. In addition to their desktop client, Dropbox’s server-side code is in Python as well, making it the majority language used at the company.

Google uses a mix of languages, with C++, Python, and now Go among them. Early on at Google, there was an engineering decision to use “Python where we can, C++ where we must.” Python was used for parts that required rapid delivery and maintenance. Then, they used C++ for the parts of the software stack where it was important to have very low latency and/or tight control of memory.  

Like Google, Spotify and Netflix use a mix of languages. Spotify uses Java heavily, but uses Python for things like their Web API and their Interactive API console, which lets developers explore endpoints with an easy-to-use interface. Spotify also uses Python for data analytics and other non-customer facing processes, such as a DNS server recovery system, their payment system, and their label content management system.  Netflix uses a mix of Java, Scala, and Python, and gives developers autonomy when choosing which language fits the problem best. Where do they use Python most? They heavily use Python and iPython in their real-time analytics group.

If you take a look at these companies, you can see they benefit from Python for its ease of use and because it’s great for rapid prototyping and iteration. You can also see that Python can be used for a wide variety of applications, and as you learn the basics of Python, you’ll be able to create almost anything you want. Many great developers contribute daily to the Python community by creating Python libraries. These libraries can help you get started so that you don’t have to write code to reinvent the wheel. So for example, if you want to do complex image processing, the Python Imaging Library will help you get started. Want to create games? PyGame is a Python game engine. If data science is your thing, SciPy is the library for you.

There are lots of great reasons to learn Python, and hopefully a few of the examples and resources I’ve shown today have helped you see how you could be using it too. Ready to start learning Python? Check out Code School’s new Python technology Path, which features two new Python courses — Try Python and Flying Through Python — where you’ll learn the basics and leverage the power of Python!

Code School

Code School teaches web technologies in the comfort of your browser with video lessons, coding challenges, and screencasts. We strive to help you learn by doing.

Visit codeschool.com

About the Author

Sarah Holderness

Sarah Holderness

Sarah likes inventing things and teaching programming. Working at Code School allows her to do both and work with an awesome group of people. As Content Producer, she is working on building out the Python path and finding out the best way to teach Python.

Might We Suggest