by torben-friis · 1y ago · 0 comments
I am usually amused by the way really competent people judge other's context.
This post assumes understanding of:
- emacs (what it is, and terminology like buffers)
- strace
- linux directories and "everything is a file"
- environment variables
- grep and similar
- what git is
- the fact that 'git whatever' works to run a custom script if git-whatever exists in the path (this one was a TIL for me!)
- irc
- CVEs
- dynamic loaders
- file priviledges
but then feels important to explain to the audience that:
>A socket is a facility that enables interprocess communication
Juniors know how much they have learned whereas a 10+ year senior (like the author) forget most people don't know all this stuff intuitively.
I still will say stuff like "yeah it's just a string" forgetting everyone else thinks a "string" is a bit of thread/cord.
Strings are very very not sequences of bytes. Strings are a semantic thing. There may be a sequence of bytes in some representation of a particular string, but even then those bytes are not enough to define a string without other stuff. An encoding, at the very least. But even then, there are many things that could be described as a "string". A sequence of code points, perhaps? Or scalar values? Grapheme clusters?
Not to mention that you may not even have a linear sequence of bytes at the bottom level. You might have a rope (cons cell), or an intern pointer, or...
This is a profoundly stupid kind of argument. There isn't even an objective truth you could conceivably convince someone of. There's just how you're choosing to use the word in conflict with a preexisting convention, which marks you as part of some social group, just like "this slaps", "skibidi", "rad", or "whenever". The preexisting convention isn't some apprehension of objective truth either. It's just an arbitrary tradition, like the meaning of any word.
People who are using the word in the older sense are usually not mistaken. At worst, they're your political enemies, but often they aren't even that; they just have experiences you don't. Attempting to persuade them, as you are doing, can only have the effect of further narrowing your intellectual horizons—even in the unlikely case that you are successful, but especially in the far more common case where they try to avoid you after that.
I recommend more curiosity and less crusading.
(In the rare case where someone is mistaken, it's sufficient to say "I meant a Unicode string" or "but we're iterating over codepoints, not bytes," but such mere clarification is not what you're up to.)
I think we're seeing a similar disconnect here. Some people think a string is a contiguous block of bytes, perhaps with a sentinel value on the end (C string) or a fixed-size count on the front. Others think of it as an API for storing text. These used to overlap, but in recent decades they have diverged substantially. The argument here is about the meaning of the word, not the technical reality of the thing it refers to, so it has no objective resolution.
Strings are sequences of bytes only in the sense that everything stored in memory is a sequence of bytes. The semantics matter far more, and they aren’t the same as a sequence of bytes.
Also many languages make strings immutable and byte arrays mutable.
In most programming languages strings contains more semantics than just sequences of bytes.
For example in Rust all Strings are utf-8, so Rust strings are binary sequences but not all binary sequences can be Rust strings.
As someone younger, ports and sockets appeared very early in my learning. I'd say they appeared in passing before programming even, as we had to deal with router issues to get some online games or p2p programs to work.
And conversely, some of the other topics are in the 'completely optional' category. Many of my colleagues work on IDEs from the start, and some may not even have used git in its command line form at all, though I think that extreme is more rare.
>The term socket dates to the publication of RFC 147 in 1971, when it was used in the ARPANET. Most modern implementations of sockets are based on Berkeley sockets (1983), and other stacks such as Winsock (1991).
[1] https://en.wikipedia.org/wiki/Berkeley_sockets
[2] https://medium.com/theconsole/40-years-of-berkeley-sockets-8...
Though one explanation is that I think for the other stuff that the writer doesn't explain, one can just guess and be half right, and even if the reader guesses wrong, isn't critical to the bug — but sockets and capabilities are the concepts that are required to understand the post.
It still is amusing and I wouldn't have even realized that until you pointed that out.
The author is both an example of and an example for how we can get caught in "bubbles" of tools/things we know and use and don't, and blog posts like this are great for discovery (I didn't know about git invoking a binary in the path like his "git re-edit", for example, until today).
It’s not that I was unaware that’s how Unix worked here, just that I rarely think of sockets in that context.
I would expect a person with 10+ years of Unix sysadmin experience — but who has never programmed directly against any OS APIs, “merely” scripting together invocations of userland CLI tools — to have exactly this kind of lopsided knowledge.
(And that pattern is more common than you might think; if you remember installing early SuSE or Slackware on a random beige box, it probably applies to you!)
Then he didn't go back to clean it up afterwards.
I agree that it's amusing.