Rob Pike spins a yarn about UTF-8 so tangled, not even the cat π± can keep up with his yarn ball antics. Between obscure references and enough tech #buzzwords to power a startup π, you'll be left wondering if this is documentation or a geek's fever dream π€. Remember, UTF-8 might be "universal," but understanding this article isn't! π€―
https://doc.cat-v.org/bell_labs/utf-8_history #RobPike #UTF8 #YarnTech #GeekFeverDream #HackerNews #ngated
![[β¦]Long ago, as the design of the Unix file system was being worked out, the entries . and .. appeared, to make navigation easier. I'm not sure but I believe .. went in during the Version 2 rewrite, when the file system became hierarchical (it had a very different structure early on). When one typed ls, however, these files appeared, so either Ken or Dennis added a simple test to the program. It was in assembler then, but the code in question was equivalent to something like this:
if (name[0] == '.') continue;
This statement was a little shorter than what it should have been, which is
if (strcmp(name, ".") == 0 || strcmp(name, "..") == 0) continue;
but hey, it was easy.
Two things resulted.
First, a bad precedent was set. A lot of other lazy programmers introduced bugs by making the same simplification. Actual files beginning with periods are often skipped when they should be counted.
Second, and much worse, the idea of a "hidden" or "dot" file was created. As a consequence, more lazy programmers started dropping files into everyone's home directory. I don't have all that much stuff installed on the machine I'm using to type this, but my home directory has about a hundred dot files and I don't even know what most of them are or whether they're still needed. Every file name evaluation that goes through my home directory is slowed down by this accumulated sludge.
I'm pretty sure the concept of a hidden file was an unintended consequence. It was certainly a mistake[β¦]](https://files.mastodon.social/media_attachments/files/027/654/884/small/41b0d9eb993374bc.png)