3 most annoying Python myths
Student Login

3 most annoying Python myths

Have you noticed people like to form opinions?

I'd like to say "other people", but I'm an unstoppable opinion-forming machine. Just one bit of data is enough for my brain to leap to some kind of stoopidly sweeping generalization. Which I don't like, so I ask my brain nicely to stop.

It doesn't stop. Sigh.

Maybe this human tendency is why there are so many myths about Python hopping and bopping around out there.

A few of my "favorites":

1) PYTHON IS ONLY FOR X

"Python is only for scripting."

"Python is only for web development."

"Python is only for data analysis."

"Python is only for this stupid thing no one cares about - unlike my favorite language, which is awesome at everything that matters."

The reality: Python is useful for many different engineering domains. More than any other language, maybe.

2) PYTHON IS WEAKLY TYPED

No it's not. The stupid people who aren't subscribed to this newsletter need to stop saying that.

Type systems have at least two dimensions. A language can have a type system that's strongly typed; or it can be weakly typed.

And: regardless of whether it's strong or weak, that type system can be either dynamic, or static.

Python's type system is crazy dynamic. But it's also strongly typed.

This is why you can't add a string to an integer in Python, for example. Try it - you'll get a TypeError.

3) PYTHON IS SLOW

Sure, it's possible to write slow code in Python. What language doesn't make it possible?

But it's more complicated than that.

Many parts of Python, and its ecosystem, are highly optimized C... or even Fortran (!!!). Anything built on numpy, for example - and that includes scipy, pandas, scikit-learn, and so on - is going to be blazingly fast.

Even the built-in dictionary type is, under the hood, optimized C. When you write code in Python, you're using a lot of C code without realizing it.

All this is ignoring how much FASTER you can develop in Python. How many times you can go through several different, increasingly faster algorithms, in the time it would take you to code just one, in a "faster" language.

So I think this myth is, to an extent, obsoledge (remember that word, from my first email to you?)

And I think one reason myths like these persist, is that people often reason in terms of simple, toy code.

But when you look at realistic code bases, it's different. The straw men of toy code crumple and collapse.

Newsletter Bootcamp

Book Courses