Swift 5.3: What Whitespace Actually Is

A deep dive into the most basic building blocks of the language.

Paul Pela
Level Up Coding
Published in
3 min readOct 12, 2020

--

In this story I’d like to talk about something nobody ever talks about, every tutorial just simply skips, and basically everyone takes for granted without giving it a second thought.

Photo by Jess Bailey on Unsplash

I do think, however, that to become better at Swift programming, at some point you need to start with the most basic ideas and go up from there. You can break this pattern at the beginning to dive in as quickly as possible and start creating code, but there comes a point where you want to move into more professional level and return to the basics.

At this levelling-up point you start to think not only about how to use the language to create software, you also start to think about how the language itself works, what it means when you write something, what the parser and compiler do with the plaintext source files to turn those into executable code and take advantage of that knowledge to write even better code.

Let’s start with whitespace.

Whitespace is present in every single Swift file you create. Without whitespace, there would be no valid Swift code. The parser would not be able to understand any of our files.

--

--

Future dad, 9to5: tech support agent. I write about the User Experience of learning programming.