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

←back to thread

311 points todsacerdoti | 55 comments | | HN request time: 0.612s | source | bottom
1. 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 #
2. 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 #
3. 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 #
4. 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 #
5. bigiain ◴[] No.46237854{3}[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 #
6. nonameiguess ◴[] No.46238238[source]
It also seems wrong? libsodium explains the logic in its name right on its about page. It's a fork of NaCL (the chemical formula for sodium salt), which itself is a plain acronym for "networking and cryptography library." Google doesn't seem like a good example, either. Wasn't that meant to be an allusion to the very large number googolplex, as in Google exists to tame the unfathomably large amount of information on the web? The author may or may not like those names, but they have a logic just like grep and awk do.
replies(1): >>46239878 #
7. 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 #
8. pavel_lishin ◴[] No.46238259{3}[source]
"libsodium" -> "salt" -> "salting is something tangentially related to cryptography" is significantly better as a mnemonic than "awk stands for the author's initials".
9. jolmg ◴[] No.46238322{4}[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.

10. bee_rider ◴[] No.46238337[source]
I’m not sure I like awk, sed, or cat, I think these are just names we’re used to, not good really. diff seems ok.

grep almost has an onomatopoeic nature to it… like, it sounds like you are grabbing or ripping the patterns out of the file, right?

replies(2): >>46240190 #>>46241191 #
11. 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 #
12. wombatpm ◴[] No.46238756{3}[source]
Relevant XKCD

Https://xkcd.com/1168/

replies(1): >>46239193 #
13. embedding-shape ◴[] No.46238768{3}[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".
14. i_am_proteus ◴[] No.46238800[source]
So few of us use physical tapes these days, but the "tape archive" (tar) remains ubiquitous.

Not entirely unserious: "awk" is a good name because it is three characters to type "rg" is better than "grep" because it is two fewer characters type

replies(2): >>46240228 #>>46241480 #
15. DSMan195276 ◴[] No.46238821[source]
Yeah this definitely falls into the category of "I use them so they feel natural", there's nothing amazing about those names.

The underlying problem is that you now run into so many named things (utilities, libraries, programs, etc.) in a day and they all have to differentiate themselves somehow. You can't name every crypto library `libcrypto` for obvious reasons.

replies(2): >>46238865 #>>46242675 #
16. groos ◴[] No.46238865[source]
Fine. Name it sodium-crypto.a or sodium.crypto.a or whatever. The author's complaint does hold water.
replies(2): >>46240256 #>>46241104 #
17. QuercusMax ◴[] No.46238937[source]
https://en.wikipedia.org/wiki/Libiberty was always my favorite ridiculous name. It was named so you can link it with -liberty.
replies(3): >>46239747 #>>46240496 #>>46242572 #
18. foobarian ◴[] No.46239079{4}[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.
19. WJW ◴[] No.46239193{4}[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 #
20. 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.

21. gowld ◴[] No.46239204[source]
awk is short for awkward, like awkword, for awkwardly manipulating words (text).
22. 1vuio0pswjnm7 ◴[] No.46239290[source]
Nitpick: Correct me if wrong but I think cat is catenate not concatenate

IMHO, the best names are the ones that are easiest to type. I have read several accounts of authors choosing names for this reason

I sometimes rename other peoples' executables (cf. libraries), not the ones in the traditional UNIX userland, but the ones with goofy names.^1 I will rename them to something I find easier to type and less annoying. I create symbolic links with the original names if I think they will be required^2

With own software, I give every program a number, the source file is named according to the number and the executable name is a short prefix followed by the number. All names are the same length. I have a text file that lists what each program does if I forget

I put a description in a comment at the top of each source file as a sort of header. Then I can do something like

   head src/???.l  
for a list of descriptions

1. Needless to say, Arthur Whitney's software does not get renamed. No need, he gets it

2. I will also rewrite the argument parsing and "usage:" output if it annoys me

The best way to determine what a program does is to read the source. This is one reason I prefer to compile programs from source instead of using "binary packages"

I also think the names that are chosen for so-called "tech" companies are routinely quite silly, but that's another discussion

23. chihuahua ◴[] No.46239395{5}[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 #
24. ◴[] No.46239455{3}[source]
25. tharkun__ ◴[] No.46239536{6}[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 #
26. MarsIronPI ◴[] No.46239747[source]
Used to be that Ruby's "rubygems" library had an alias "ubygems" so that when invoking ruby with the -r option (to require a library) you could say "ruby -rubygems". Sadly, they seem to have removed this alias library sometime around Ruby 2.4.
27. ◴[] No.46239860[source]
28. j16sdiz ◴[] No.46239878[source]
it should have been called chlorine for "Cl" is the cryptography library in "NaCL"
29. anyfoo ◴[] No.46240068{6}[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
30. necovek ◴[] No.46240177{3}[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 #
31. squigz ◴[] No.46240190[source]
They're good names because they're short and easily recognizable
replies(1): >>46240503 #
32. necovek ◴[] No.46240202{5}[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.

33. necovek ◴[] No.46240224{7}[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.

34. necovek ◴[] No.46240228[source]
I would if they weren't so outrageously expensive (tapes and tape drives ;))
35. DSMan195276 ◴[] No.46240256{3}[source]
You can, but then the names get needlessly long and one of the things we generally like (especially for command-line programs) is names that are short and easy to type. If we're going to make this argument then why not call the unix tools `concatenate`, `difference`, `stream-editor`, etc. Those are way better names in terms of telling you what they do, but from a usability standpoint they stink to type out.

Libraries and programs also have a habit of gradually changing what exactly they're about and used for. Changing their name at that point doesn't usually make sense, so you'll still end up with long names that don't actually match exactly what it does. Imagine if we were typing out `tape-archive` to make tarballs, it's a historically accurate name but gives you no hint about how people actually use it today. The name remains only because `tar` is pretty generic and there's too much inertia to change it. Honestly I'd say `cat` is the same, It's pretty rare that I see someone actually use it to concatenate multiple files rather than dump a single file to stdout.

The author is missing the fact that stuff like `libsodium` is no differently named from all the other stuff he mentioned. If he used libsodium often then he may just as well have mentioned it as well-named due to it's relation to salt and would instead be complaining about some other library name that he doesn't know much about or doesn't use often. I _understand_ why he's annoyed, but my point is that it's simply nothing new and he's just noticing it now.

replies(1): >>46240404 #
36. thaumasiotes ◴[] No.46240333[source]
> It's ridiculous to complain about "libsodium" and then hold up "awk" as a good name.

Awk is short, easy to pronounce, and difficult to confuse with anything else. It's nearly as perfect as a name can be.

> 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.

You seem to have confused the concept of a "name" with that of a "description". The whole point of names is that they aren't descriptive.

https://en.wikipedia.org/wiki/Arbitrariness#Linguistics

replies(1): >>46242657 #
37. lanstin ◴[] No.46240404{4}[source]
libeay
38. lanstin ◴[] No.46240412{3}[source]
creat(...)
39. lmm ◴[] No.46240496[source]
A friend created a library called library which was kind of a converse to that (you had to link it with -lrary). It was funny for 30 seconds and then just annoying.
40. lmm ◴[] No.46240503{3}[source]
There are only so many short names to go around.
41. kazinator ◴[] No.46240524[source]
cat is arguably from catenate, which is the smarter, shorter version of concatenate. By default, unadorned catenation is a joining (literally "making into a chain"), which is always together/with, so the con prefix is redundant. If you ever need a derivative of catenate that means splitting apart, you can coin discatenate, where the dis then plays an essential role.

Also, why is it that people are gregarious when they congregate, and not congregarious? Or why didn't they just gregate? There was such a Latin cognate verb without the con attached.

42. bigiain ◴[] No.46240880{4}[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.
43. tolciho ◴[] No.46241039{5}[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 #
44. kibwen ◴[] No.46241104{3}[source]
> The author's complaint does hold water.

Ironically, much like sodium itself, a substance of which the author seemingly possesses too much of.

45. fsckboy ◴[] No.46241191[source]
>I’m not sure I like awk, sed, or cat

sed is not "stream editor" as it says above, it's "stream ed", where ed was another prexisting program which was essential and everybody knew it. its name was from "editor" shortened.

the sed commands are the ed commands. so, it's almost not possible to say "i don't like the name", it rests on a rich tradition, it's the stream version of ed. (ed commands are very similar to vi commands at heart.) it's sad the unix crowd never grokked teco because teco was already a programmable stream editor from a tradition that was not particulary streamy. it predated ed by a decade and would have fit the unix world perfectly. maybe it was already too big? I'm sure they would have known about it. Emacs does come from the teco tradition.

grep got its name from what the "grep" command would look like typed within the ed editor.

awk should not be thought of as a tool, it's a programming language, and has every right to the name as ada or pascal or haskell does.

back in those days, filenames had to be short, long names were not allowed, no space, and also, people liked typing short commands. concatenate shortened is... well, cat is as good a name as any. back then the word console was popular for the name of the terminal connected directly to the computer (frequently already logged in), perhaps con was already in use then, it definitely had a meaning already on DEC operating system machines as inherited on Microsoft machines, CON: is still console, and Bell Labs was using DEC machines.

btw at some sites there is a "dog" command. it's like the "cat" command, but it starts at the end of the file and then shows any additions. so, if you want to see if anything is being added to a logfile, you can "dog" the file (which is completely broken when VMS Windows dorks show up and decide to make everything binary) now the verb "to dog" in English means "to follow closely", so it's a cute wordplay on cat and means what it does, similar to "less is more". in less, you can accomplish something like "dog" (dog with more context) with the "F" command. these individual pieces of wordplay don't form a coherent network in the end, but as new things are invented over time they are fun and help you remember new commands till you get used to them.

replies(1): >>46241459 #
46. rswail ◴[] No.46241459{3}[source]
> ed commands are very similar to vi commands at heart

vi was build on top of ed.

Ed was the Unix line editor, which is why all the commands after a colon have the form of "start,endcommand", eg "1,$p" would list all the lines of a file on your tty/decwriter.

1,$s/findexp/replace/g would s ubstitute all examples ("g") of findexp on the lines 1 through EOF

47. rswail ◴[] No.46241480[source]
There's a reason why the basic Unix file commands are ls, cp, mv, rm.

They're easy to type on a TTY.

grep is from the ed command "g/re/p" which is g (all lines, short for "1,$") /re/ regular expression to search for, "p" to print the lines.

It still works in vi.

48. pharrington ◴[] No.46241933{6}[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 #
49. lloeki ◴[] No.46242454{7}[source]
> maybe i missed the joke?

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

50. ezconnect ◴[] No.46242479[source]
The problem with current naming is it now using common names like coffee and it's hard to search for them or relate to them. At least the old Unix naming are kinda unique and sometimes means something. Unlike today.
51. mr_mitm ◴[] No.46242572[source]
There is also https://github.com/gebi/libowfat
52. jcparkyn ◴[] No.46242657[source]
> The whole point of names is that they aren't descriptive

I actually agree with this, but that's exactly the opposite of what TFA is arguing.

53. ◴[] No.46242675[source]
54. 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?

55. apetrovic ◴[] No.46243231[source]
You don't need to go that deep into the article. Just - emacs. Of course I know what it is, I had to google the name to find it's EditorMACroS