avatarThomas Smith

Summary

The article discusses the challenges of visually representing whitespace characters, particularly in coding contexts, and the solutions that have been developed to address this issue.

Abstract

The article "A Search for the Whitespace Character" delves into the complexities of visually representing a whitespace character, a conceptually simple yet practically challenging task. It notes that while a regular space is commonly used, its invisibility makes it ineffective for clear representation in written or handwritten code. The article suggests using an underscore as a more visible alternative but acknowledges that this can lead to confusion when underscores are needed for their actual character value, such as in variable names or regular expressions. The Open Box character (U+2423), introduced in the 1980s, is presented as a solution for representing whitespace in handwritten code. However, the article highlights the inconsistent support for this character across various software, including text editors and graphic design tools like Photoshop, which necessitated a cumbersome workaround to use the Open Box in the publication's logo. The author reflects on the broader challenges of character set inconsistencies and the uneven implementation of Unicode, expressing gratitude for finding the Open Box character for the logo despite these obstacles.

Opinions

  • The author believes that representing whitespace with a regular space is inadequate, especially in coding scenarios where visibility is crucial.
  • The use of an underscore is seen as a practical, albeit imperfect, solution for representing whitespace in written code, with the caveat that it can cause confusion in certain contexts.
  • The Open Box character is favored by the author for its intended purpose of representing whitespace, but its limited support in software is viewed as a significant inconvenience.
  • The author expresses frustration with the inconsistent implementation of Unicode and the lack of attention given to less common characters by font designers.
  • The author values the Open Box character enough to go through an extensive process to include it in the publication's logo, underscoring its importance in representing nothing in code.

A Search for the Whitespace Character

How do you represent nothing?

Photo by Stephen Wood on Unsplash

How do you represent nothing?

It’s a surprisingly challenging problem, which has spawned an annoying array of solutions.

For normal users, the typical method is to use a space. Here’s one:

See it? No? That’s one challenge. If you’re trying to draw out code — especially on paper — a space doesn’t really cut it when it comes to representing whitespace.

Underscore is a better option:

_

At least you can see it’s there. It’s a good substitute for an explicit space character if you’re writing out code on paper.

But there are some times when you need an underscore to be an underscore. What if you’re using in in a variable name? What if you’re using Regex, where it has an explicit, non-space meaning?

That’s where Unicode U+2423 comes it. Offically called the Open Box character, it was used starting in the 1980s to represent black space in handwritten code.

Medium is able to show it. Many text editors are not.

I wanted the Open Box to be the symbol for this publication, but Photoshop couldn’t handle it. So I had to type one into Word, make it huge, screenshot it, import that into Photoshop, and magic erase out the background to get the actual character. It was a lot of work to represent nothing.

I think this underscores (pun very much intended) the challenges of different character sets. Unicode is great, but inconsistently implemented. And font designers are happy to give you a ~ or a &, but they’re less likely to make it all the way down the unicode chart to obscure control characters like the good old fashioned ␣.

I’m glad I was able to find it for my logo here. The next time you see it used, remember that representing nothing — especially in code — is a surprisingly challenging proposition.

Programming
Software Development
Design
Fonts
White Space
Recommended from ReadMedium