Whitespace refers to spaces and tabs but also all the other invisible characters that might be printed out by your program — including color codes which aren’t white at all.
Syntactically Significant or Not?
Significant white space is when a language creator forces you to use spaces or tabs in the language to mean something different. Having a space in the wrong place forces you to have a syntax error.
I’m very thankful that the world is roundly dismissing significant whitespace now by throwing out most budding languages that use it. The following are all dead or dying:
- CoffeeScript — remember that crazy trendy obsession?
- Jade/Pug — die, die, die
Python’s Broken Syntax
Python is the worst offender with significant whitespace. I’ve stopped counting how many serious problems beginners have with mixing tabs and spaces in the same file — which many still don’t know is illegal in Python syntax.
The decision to force code to line up and not need brackets was the dumbest language design decision every made by humans.
Preventing Anonymous Functions
For the very curious you can research the thread about adding better anonymous functions support to the Python language — one of its most brain-dead moronic omissions.
There you will find a bunch of engineers trying to come up with what the syntax for such would even look like. At every turn those who would reform the language by adding what almost every other language has were thwarted by Python’s mandatory significant white space. Finally, near the end of the thread Guido punts and says, essentially, “just no.” He’s designed one of the worst language syntaxes ever to reach popularity among the masses — and as usually the masses don’t even know why.
Python proponents continue to defend this as a “plus” and being more explicit. But the world has well proven that a chained functional paradigm (don’t worry if you didn’t understand that) is much more desirable in a multicore asynchronous world. It’s no surprise, then, that Python asynchronous programming support is abysmal.
The Reason Hackers Use Ruby Instead
Ruby has a much better syntax than Perl and Python. It is absolutely beautiful — its just fading in popularity for other reasons, mostly the move to modern languages that compile instantly to machine code but have easier syntaxes like Crystal, Go, and Swift.