A few words about Python

Author

Marie-Hélène Burle

Before we start our course, let’s talk briefly about Python, its history, its strengths, and its limitations.

An interpreted language

Compiled languages

Compiled languages require two steps:

  • In a first step the code you write in a human-readable format (the source code, usually in plain text) gets compiled into machine code.

  • It is then this machine code that is used to process your data.

So you write a script, compile it, then use it.

noshadow

Because machine code is a lot easier to process by computers, compiled languages are fast. The two step process however makes prototyping new code less practical, these languages are hard to learn, and debugging compilation errors can be challenging.

Examples of compiled languages include C, C++, Fortran, Go, and Haskell.

Interpreted languages

Interpreted languages on the other hand are executed directly. This has many advantages such as dynamic typing and direct feed-back. They are easy to learn and prototyping and debugging are a lot simpler. This however comes at the cost of efficiency.

noshadow

The source code can facultatively be bytecompiled into non human-readable, more compact, lower level bytecode which is read by the interpreter a bit more efficiently.

Examples of interpreted languages include R, Perl, JavaScript, and for our purpose here, Python.

Python’s pros and cons

To sum up, here are the main strong points and drawbacks of Python:

Strengths
Very popular
Large number of libraries
Friendly syntax
Interpreted (easy prototyping)
Dominant language in deep learning frameworks
Numerous resources
Weaknesses
Slow
Memory intensive
Threading limitations
OOP added after the fact and clunky
Runtime errors (dynamic typing)