Member-only story

The Case Against Significant Whitespace

Why I don’t like the Python solution of using indentation to mark code blocks

Erik Engheim
3 min readMar 13, 2021

Let me just preface this discussion by stating that I don’t think this is a big problem. In fact, I think people make too big of a deal of it. It really bothers me how people fixate on particular things that are not all that significant in a language to hate on it.

That could be people complaining about Go non-stop because it doesn’t have generics or because the Go designers dared to allow null-pointers.

As a Julia developer, I get tired of hearing about the horrors of 1-based indexing. And I know Python developers get tired of people complaining about significant whitespace. So let me make it clear I am not arguing there that significant whitespace is a reason to stay away from Python. That should be the least of your concerns.

Rather, this is an argument against all those people who seem to think significant whitespace is the best thing since sliced bread and that we should use it more, and everywhere. No, please, let us just accept that Python made a mistake, but not a very serious one. No need to repeat it.

Significant Whitespace Complicated Language Design

When you use significant whitespace, it complicates a lot in your language design. This means any new language that decides to follow Python will run into problems, which will in turn require various…

--

--

Erik Engheim
Erik Engheim

Written by Erik Engheim

Geek dad, living in Oslo, Norway with passion for UX, Julia programming, science, teaching, reading and writing.

Responses (1)