Most active commenters
  • bigiain(3)
  • necovek(3)

←back to thread

311 points todsacerdoti | 27 comments | | HN request time: 0.209s | source | bottom
Show context
plorkyeran ◴[] No.46237424[source]
> grep (global regular expression print), awk (Aho, Weinberger, Kernighan; the creators’ initials), sed (stream editor), cat (concatenate), diff (difference). Even when abbreviated, these names were either functional descriptions or systematic derivations.

If you asked someone unfamiliar with unix tools what they thought each of these commands did, diff is the only one which they would have even the slightest chance of guessing. It's ridiculous to complain about "libsodium" and then hold up "awk" as a good name.

replies(13): >>46237555 #>>46237769 #>>46238238 #>>46238337 #>>46238800 #>>46238821 #>>46238937 #>>46239204 #>>46239290 #>>46240333 #>>46240524 #>>46242479 #>>46243231 #
1. mojuba ◴[] No.46237555[source]
However once you learn that sed means stream editor, you won't ever forget it. libsodium is forgettable.
replies(7): >>46237653 #>>46237672 #>>46238241 #>>46238519 #>>46239194 #>>46239860 #>>46242688 #
2. jolmg ◴[] No.46237653[source]
That's part of the point, I believe. It's not about being always able to guess the function from first sight. It's also about the function and name serving as mnemonic to each other once you understand how it got named.
replies(2): >>46237854 #>>46238259 #
3. bigiain ◴[] No.46237672[source]
Same for grep - with, I guess, the proviso/assumption that you know what regular expression means, which might have been a fair assumption for the sort of people who had command line access to Unix systems in the 70s/80s, but may no longer be valid for developers under 30 who grew up with Windows and were perhaps trained in 6 or 26 week "bootcamps" that didn't have time to cover historical basics like that?
replies(1): >>46240177 #
4. bigiain ◴[] No.46237854[source]
I think perhaps the articles argument gets less strong then?

It's claimed grep is "well named" because even though it's not obvious when you first read it, that it being a contraction for "global reg ex print" and hence memorable. I'm not sure the same argument can't be made for libsodium which assuming the reader is familiar with NaCl (the same as the assumption that the previous reader is familiar with regex) then it's an equally memorable name for your crypto library.

There's always a consideration about the context the name is intended and likely to be used in. The article mentions engineering naming and "ibeam", but engineering has it's own technical names an jargon as well. Most people wont know what "4130 tube" means, but people who build bicycle frames or roll cages will - and they're likely to use the less specific term "chromoly" if the don't need to distinguish between 4130 and 4145.

In my head "libsodium" is similar - if you don't know what it (and NaCl) mean, you 100% should keep out of that part of the codebase.

replies(2): >>46238322 #>>46239079 #
5. pavel_lishin ◴[] No.46238241[source]
> However once you learn that sed means stream editor, you won't ever forget it.

I feel like this is approximately the third time I'm learning this.

replies(1): >>46238768 #
6. pavel_lishin ◴[] No.46238259[source]
"libsodium" -> "salt" -> "salting is something tangentially related to cryptography" is significantly better as a mnemonic than "awk stands for the author's initials".
7. jolmg ◴[] No.46238322{3}[source]
Names fall on a spectrum on this argument. Sodium is not really random because of the use of "salt" on crypto. It's like saying that libsodium is part of your crypto. awk is more random.

The argument goes stronger with projects where the creator seemed to just roll the dice with the name.

8. forrestthewoods ◴[] No.46238519[source]
lol no. There are literally a hundred plus Unix tools and commands. I couldn’t tell you what 90% of them mean. I sure as hell couldn’t have told you what sed stood for. And if you asked me tomorrow I also wouldn’t be able to tell you.

C programmers are great. I love C. I wish everything had a beautiful pure C API. But C programmers are strictly banned from naming things. Their naming privileges have been revoked, permanently.

replies(3): >>46238756 #>>46239455 #>>46240412 #
9. wombatpm ◴[] No.46238756[source]
Relevant XKCD

Https://xkcd.com/1168/

replies(1): >>46239193 #
10. embedding-shape ◴[] No.46238768[source]
I've been using Linux for almost 20 years, including sed a lot of that time, I'm sure I've heard it before, I must have, but when parent wrote it I was like "aah, that makes sense".
11. foobarian ◴[] No.46239079{3}[source]
One additional complication with grep (and other CLI tools) is that the name itself is part of the day to day UX. It needs to be short, easy to say, and easy to type. With a library the API that is contained within serves the analogous role.
12. WJW ◴[] No.46239193{3}[source]
Someone once tried this on me during Friday drinks and I successfully conquered the challenge with "tar --help". The challenger tried in vain to claim that this was not valid, but everyone present agreed that an exit code of zero meant that it was a valid solution.
replies(3): >>46239395 #>>46240202 #>>46241039 #
13. homebrewer ◴[] No.46239194[source]
Don't forget that you need to know English for that to work. I'm pretty sure most Unix users don't speak English (most computer users definitely don't). I interact with people who know few words besides "hello" and "goodbye", and for them "sed" is a nonsense term, just a set of letters randomly thrown together. Same as e.g. Excel, a random token that means nothing.

sed is just an example, of course, the author's point doesn't hold much weight for many (most?) users globally.

14. chihuahua ◴[] No.46239395{4}[source]
I seem to remember "tar xvf filename.tar" from the 1990s, I'll try that out. If I'm wrong, I'll be dead before I even notice anything. That's better than dying of cancer or Alzheimer's.
replies(2): >>46239536 #>>46240068 #
15. ◴[] No.46239455[source]
16. tharkun__ ◴[] No.46239536{5}[source]

    tar zxvf
Is burnt into my brain. One of my earliest Linux command line experience required untaring zipped tars.

So yeah that xkcd is "not funny" to me in that sense. Of course I couldn't tell you pretty much any other use without a man page.

replies(1): >>46240224 #
17. ◴[] No.46239860[source]
18. anyfoo ◴[] No.46240068{5}[source]
I still do that at least once a week. Along with "tar xzpvf" or more complex invocations like:

    tar cvf - -C /foo/bar baz | zstd > foo.tar.zstd
19. necovek ◴[] No.46240177[source]
Regular expressions are more of a CS topic (regular languages), though common abbrevs of "re" and "regex" I've only seen in the wild pre and post my formal education in CS.
replies(1): >>46240880 #
20. necovek ◴[] No.46240202{4}[source]
This works with GNU tar, but likely not with tar on other Unix systems.

"tar cf /tmp/a.tar $HOME" would, I guess, work on all POSIX systems.

21. necovek ◴[] No.46240224{6}[source]
z requires it's compressed with gzip and is likely a GNU extension too (it was j for bzip2 iirc). It's also important to keep f the last because it is parametrized and a filename should follow.

So I'd always go with c (create) instead of x (extract), as the latter assumes an existing tar file (zx or xz even a gzipped tar file too; not sure if it's smart enough to autodetect compress-ed .Z files vs .gz either): with create, higher chances of survival in that xkcd.

22. lanstin ◴[] No.46240412[source]
creat(...)
23. bigiain ◴[] No.46240880{3}[source]
Yeah, I'd totally expect CS grads, old school Unix sysadmins, and Perl hackers to be fully familiar with Regex. Not so sure I'd expect that from bootcamp front end webdev "grads", self touch game devs, or maybe (I'm not sure?) engineers who have spent their careers in Microsoft dev environments.
24. tolciho ◴[] No.46241039{4}[source]

  $ tar --help
  tar: unknown option -- -
  usage: tar {crtux}[014578beFfHhjLmNOoPpqsvwXZz]
             [blocking-factor | format | archive | replstr]
             [-C directory] [-I file] [file ...]
         tar {-crtux} [-014578eHhjLmNOoPpqvwXZz] [-b blocking-factor]
             [-C directory] [-F format] [-f archive] [-I file]
             [-s replstr] [file ...]
  $ echo $?
  1
replies(1): >>46241933 #
25. pharrington ◴[] No.46241933{5}[source]
That is not GNU tar's output. You might wanna make sure your installation is ok.

edit: maybe i missed the joke?

replies(1): >>46242454 #
26. lloeki ◴[] No.46242454{6}[source]
> maybe i missed the joke?

the bomb specifies only "unix" so you can't assume GNU (which, aha, is Not Unix)

27. Gigachad ◴[] No.46242688[source]
Libsodium isn’t a tool or program the average user casually uses. Anyone who actually has to use it in their project even once will remember it.

How often do you forget what Firefox or Gnome are?