Chapter 3 Ramping Up with Concurrent Code

Intuitive Python — by David Muller (22 / 41)

The Pragmatic Programmers
The Pragmatic Programmers

--

👈 Wrapping Up | TOC | Approach Concurrency with Caution 👉

It’s a chilly autumn morning, and several hundred runners are lined up behind the starting line. The runners are excited to begin the 10-kilometer race, and I’m one of them.

I’ve never won a race. It’s not for lack of trying — I’ve run plenty of races over varying distances. But I’ve never won.

Sometimes I’ll start a race off at a good pace and then get a stitch in my side and slow down. I usually feel like I’m running fast, but then I’ll be halfway through a race only to see a parent pushing a child in a stroller and chatting on a cell phone pass me. I prepare for the race by jogging the distance on my own ahead of time. But, whatever I do, there’s always someone that day who is faster.

I compensate for my losing streak by entering more races. I don’t win any of those either.

Am I a slow runner? Yes. Does this have anything to do with Python? Yes.

Python runs your programs slowly. There, I said it! Maybe you already suspected as much, maybe you only feared as much, but now you know. Python runs slow. Programs written in Go, Java, Rust, or other languages often beat Python in straight line races.

In real life, I make up for not winning races by running more races. It can be the same with Python.

--

--

The Pragmatic Programmers
The Pragmatic Programmers

We create timely, practical books and learning resources on classic and cutting-edge topics to help you practice your craft and accelerate your career.