4 ms·
I feel the same way about many *nix commands. A while ago I thought it was neat to have TLAs[1] for everything, but now I just think it's bad "API" design. Why
by phoboslab 13y ago
I feel the same way about many *nix commands. A while ago I thought it was neat to have TLAs[1] for everything, but now I just think it's bad "API" design.
Why is it ls instead of list? chmod instead of permissions? grep instead of search? mv, cp, rm instead of move, copy, remove? Is it really so much work to type a few more characters to justify this?
Programming langue APIs (or rather their libraries) have come a long way since the C days in that regard, but OS wise we're still stuck with these cryptic names.
[1] http://en.wikipedia.org/wiki/Three-letter_acronym http://en.wikipedia.org/wiki/Three-letter_acronym
- Peaker 13y ago*nix commands are optimized for minimizing keystrokes, too. Would you like to type out 2-3x more characters per command?
- phoboslab 13y agoYes, I wouldn't mind. That's what I'm saying. Imho it's a false assumption that you have to "minimize keystrokes". Programming languages noticed this a while ago. The time I spent thinking "what was that command again?" is far greater than the time I would need to type a few more characters.
- RBerenguel 13y agoAs I answered about (so I'm repeating it again :D) minimising keystrokes can also minimise typos (or generate horribly harmful ones, too, agreed)
- thaumasiotes 13y ago> The time I spent thinking "what was that command again?" is far greater than the time I would need to type a few more characters. For ls? rm? mv? I use ls many times per day. Lengthening the name would be a huge loss for absolutely no gain; the odds of my forgetting what it's called are precisely zero. The more you use something, the more gain you get from a short name; unix commands are a near-perfect example of where even cryptic names (which mv, cp, rm, and ls do not qualify as) are very desirable.
- nknighthb 13y agoCommands are not APIs, and an interactive shell is not a programming language. It's an interactive user interface that some of us spend significant portions of our lives dealing with. I no more want to type an API-like "list_files" command ten billion times than I want to have it take ten mouse clicks to launch an application.
- MichaelGG 13y agoPowerShell does that - everything's a long verbose command. It helps avoid clashes in the global namespace. But it's only really usable with autocomplete. Same with Java, C#, and so on. Also, in local scope, long verbose names are far less readable. It might seem more skimmable or easy to get into a codebase with verbose names, but when you're debugging pieces of code, all the extra letters seem to clutter things up.
- mkesper 13y agoSure, t, i, j and f are much more readable than elapsed_time, row_index, col_index and input_file. ;)
- RBerenguel 13y agoI don't mind that much unix commands, in general (with their names, not with their usage, I hate using grep and find.) I hate chmod, too, because I can't remember exactly what permissions are what (number-wise.) My fault, not his. But I'd love it to be named "grant" and have a neater language. Like grant user/group/whatever read,write,execute (rwx are actually okayish...) filename. I know chmod is more or less like this. But I don't stand it. It's like combinatoric problems, something deep inside of me refuses to accept doing it :) I guess you know what grep stands for, don't you? It's a "legacy" command from an early version of ed, g/re/p as in "global search" a "re"gex "p"rinting results. It could be named re (for regex, search implicit) or res (I like this.) Anyway, I use ag (the silver searcher) for text/code search, though. Less letters, easier to use (I keep forgetting if I need -r, -e and all that, ag makes it somewhat easier.) As for mv, cp, rm, if all 2-letter acronyms were that easy to remember! Did you use extensively DOS? Most commands where far too verbose, I cringe if thinking about having to write copy to copy. Cp is just a smash with the left hand and another with the right hand and off you go. Minimise errors, 2 strokes. Actually now I wonder why in nix we have clear and not cls (or just cl) As a matter of names... Plan9 uses nix names, and since Plan9 tried to do things "differently" almost just for the sake of it, either they didn't think about it or thought it was a bad idea.
- jenrzzz 13y agoYou can use symbolic modes in chmod too if you can't remember the octal representation. For example, you could set 0755 with "u=rwx,go=rx."
- groks 13y agoWhy did you type it's instead of it is? Is it really so much work to type one more character to justify this? :-) The shell is a working language as much as English is. You'll spend more time using it than learning it, so get crackin'.
- fit2rule 13y agoMeh, whats one word cloud over another? We can just say the reason for Unix is because: history, and be done with the discussion .. throw a bit of 'its probably because IBM Selectric had easy keys for | and blah' seasoning, douse a fair bit of flamage with bowls of "oh, the monte-carlo on the keypresses says that its all EMACS fault" kerosene, but then again, like I said: whats one word cloud over another? I've heard much relief, for example, from the no-more-Powershell-users who finally 'grok' bash, while (1) grep :P * ; done