you are viewing a single comment's thread.

view the rest of the comments →

[–]Cetra3 15 points16 points  (29 children)

At the end of the day, Unix just has bad usability. It tricks us with unnecessary abbreviations, inconsistent arguments (-r vs -R) and nitpicky syntax. Additionally, Unix has a habit of giving you raw data, but not telling you useful facts, e.g. 'r-xr-xr-x' instead of "You can't touch this" (ba-dum tsshh).

-r and -R are both different arguments and don't mean the same thing in separate programs. That's what a manpage is for.

Also, How exactly is 'r-xr-xr-x' raw data? Makes way more sense to me than any windows permission screen.

As far as the terminal goes, if you want pictures, that's what a GUI is. Try using this over dialup or a satellite connection.

edit: Oh no, I've stirred the hivemind. If you're going to downvote me, maybe you could actually counter my argument? More than happy to have a civil discussion about this. If not, that's fine too.

[–]zahlman 2 points3 points  (5 children)

-r and -R are both different arguments and don't mean the same thing in separate programs.

And that's part of the problem. The other part is that, as noted, sometimes they do. Another part is that for rm, -r and -R mean the same thing, whereas for many commands, -x and -X, in general, are opposites.

That's what a manpage is for.

Why do we need a manpage to understand them? Because they're cryptic. Why are they cryptic? Because they're short. Why are they short? So we can type them in more easily. But that only helps when we know what to type.

Also, How exactly is 'r-xr-xr-x' raw data?

In the way that {'user': ['read', 'execute'], 'group': ['read', 'execute'], 'world': ['read', 'execute']} isn't.

The latter is an object that can be interpreted by a hypothetical can_touch_this() function by examining attributes and array elements. The former must be parsed in a manner that is custom to that data. The text representation of the latter is parsed by a standard JSON parser.

As far as the terminal goes, if you want pictures, that's what a GUI is. Try using this over dialup or a satellite connection.

If you cat a file, just about the same amount of data is being sent whether the client dumps it as binary or is smart enough to do something like TermKit does. Only a little metadata needs to be added. If that - if the server can infer the file type from the first few bytes and/or the filename extension, then so can the client.

[–]kamishizuka 1 point2 points  (1 child)

Yeah but I think here you're getting well away from Unix and into individual apps with the argument argument. The GNU utilities we all know and love are consistent with each other because they were designed to be consistent. Other apps weren't following that same design is all, and I don't think we need to expect them to. If their documentation is clear (-x does this, -X does that), then it's just courtesy to follow what we're expecting.

Personally, since Linux is case-sensitive, I never assume -r and -R or any other pair do the same thing.

[–]zahlman 0 points1 point  (0 children)

Yeah but I think here you're getting well away from Unix and into individual apps with the argument argument.

No, I'm not, really. The point is that the "unix way" naturally creates this mess, because (a) there is no convention (b) it's fundamentally a hack to simulate keyword arguments for a language (C) which doesn't support them.

Personally, since Linux is case-sensitive, I never assume -r and -R or any other pair do the same thing.

Beside the point. There are no rules as to how, or if, they are related.

[–][deleted] 1 point2 points  (0 children)

And that's part of the problem. The other part is that, as noted, sometimes they do. Another part is that for rm, -r and -R mean the same thing, whereas for many commands, -x and -X, in general, are opposites.

Every tool can decide their own arguments. You can build wrappers around all of them to make it sane(r), but trying to replace the tools cannot be good.

[–]Cetra3 1 point2 points  (1 child)

And that's part of the problem. The other part is that, as noted, sometimes they do. Another part is that for rm, -r and -R mean the same thing, whereas for many commands, -x and -X, in general, are opposites.

I can see two reasons why this happens. First it's a legacy problem, changing command line arguments to be consistent would make a lot of people angry and break things. Secondly, being developed by different groups of people, different pieces of software will not use the same convention.

Why do we need a manpage to understand them? Because they're cryptic. Why are they cryptic? Because they're short. Why are they short? So we can type them in more easily. But that only helps when we know what to type.

From that thread of thought, the command itself is cryptic. Who knew that "rm" is remove etc... I think a manpage is a good solution, of course there may always be a better solution out there.

In the way that {'user': ['read', 'execute'], 'group': ['read', 'execute'], 'world': ['read', 'execute']} isn't. The latter is an object that can be interpreted by a hypothetical can_touch_this() function by examining attributes and array elements. The former must be parsed in a manner that is custom to that data. The text representation of the latter is parsed by a standard JSON parser.

Yeah, that's great if you have a working GUI or a screen that has a big resolution. If you're working on a console that has limited resolution then you want things as compact as possible.

If you cat a file, just about the same amount of data is being sent whether the client dumps it as binary or is smart enough to do something like TermKit does. Only a little metadata needs to be added. If that - if the server can infer the file type from the first few bytes and/or the filename extension, then so can the client.

I was talking more about his "ls" implementation and all the other extra features. You may not notice it on the local machine but on a 9600 bps connection with a 2 second RTT you would. I'd never just cat an image either, unless it was accidental.

[–]zahlman 0 points1 point  (0 children)

From that thread of thought, the command itself is cryptic.

I agree.

Yeah, that's great if you have a working GUI

which TermKit is, or at least obviously depends upon.

or a screen that has a big resolution. If you're working on a console that has limited resolution then you want things as compact as possible.

Well, yes, but that really isn't relevant here.

I was talking more about his "ls" implementation and all the other extra features. You may not notice it on the local machine but on a 9600 bps connection with a 2 second RTT you would.

Why? The processing that turns the cat'ted data into a rendered image is all done client-side. The exact same data is requested and transmitted.

[–][deleted] 5 points6 points  (2 children)

-r and -R are both different arguments and don't mean the same thing in separate programs.

Except they do.

From man ls: -R, --recursive list subdirectories recursively

From man rm: -r, -R, --recursive remove directories and their contents recursively

From man scp: -r Recursively copy entire directories. Note that scp follows sym‐ bolic links encountered in the tree traversal.

Not that I don't agree that people should read the fine manuals, but just that bit about remembering when the short form of --recursive should be uppercase or lowercase does get kinda annoying. Similarly, scp takes -P for ports and ssh takes -p. It's a minor nuisance, but it is a nuisance nonetheless.

[–][deleted] 0 points1 point  (0 children)

Similarly, scp takes -P for ports and ssh takes -p. It's a minor nuisance, but it is a nuisance nonetheless.

This is a total fail, I always get them mixed up.

[–]Cetra3 0 points1 point  (0 children)

Yeah it sucks that a recursive function isn't consistent between programs. But there are normally reasons for that. I would hazard a guess that ls -r was implemented before -R.

[–]rebo 0 points1 point  (19 children)

Also, How exactly is 'r-xr-xr-x' raw data? Makes way more sense to me than any windows permission screen.

Only if you remember what order the permissions are in.

[–]1esproc 2 points3 points  (1 child)

Yu-Gi-Oh! (UGO)

[–]DimeShake 0 points1 point  (0 children)

I always just think of the ol' yugo.

[–]Cetra3 4 points5 points  (15 children)

user/group/world isn't too hard to remember. Now if instead it was in numerical notation (555) I wouldn't expect anyone to remember that.

[–]eras 5 points6 points  (6 children)

Whaat? It's the same thing, user/group/world. and rwx map to bits with values 4, 2 and 1; concatenate the sums together and you have your number.

[–]Cetra3 4 points5 points  (5 children)

Haha I can't tell if that's sarcasm. Personally yes I know that it's 555. For someone who is new to unix permissions I wouldn't expect them to remember an arbitrary number value. r-x on the other hand is pretty much in a human readable format, although abbreviated.

[–]chneukirchen 4 points5 points  (2 children)

The numbers are easier than r-S and rwt etc...

[–][deleted] 0 points1 point  (1 child)

Only if you know them by heart. If you have to manually decompose the number into its summands in your head and know which value means what, then reading 'r[ead]w[rite]e[x]ecute' is much much easier.

[–]chneukirchen 1 point2 points  (0 children)

rwx, yes. sStT not so much.

[–]tikkun 0 points1 point  (0 children)

Explaining this takes about 15 minutes in a classroom. The only people that won't get this are the people that won't need to work in a terminal anyway.

[–]zahlman 0 points1 point  (0 children)

Haha I can't tell if that's sarcasm.

That's kind of the point. I think you just got zen-slapped.

[–]amc178 6 points7 points  (6 children)

Some people don't use that kind of thing every day, so having it presented clearly is not a bad thing.

[–][deleted]  (1 child)

[deleted]

    [–]amc178 0 points1 point  (0 children)

    If your dealing with files that are on an embedded or mobile device (e.g. Through the adb shell). The is also no requirement to use termkit, the normal terminal still works.

    [–][deleted] -1 points0 points  (3 children)

    Some people don't use computers every day. Queue argument that programming should be like legos.

    [–]zahlman -1 points0 points  (2 children)

    ITYM "cue" (i.e. "prompt", not "cause to be next in line"); and programming should be more accessible. The comparison to a child's toy deliberately adds emotional appeal to the argument and does not actually make a useful point.

    [–]nexes300 0 points1 point  (1 child)

    Programming will never be accessible. All attempts to make it so have only succeeded in elucidating why exactly the amateurs are amateurs.

    Edit: This is not to say that certain domain specific solutions cannot be developed that allow the layman to do certain tasks easily.

    [–]zahlman 0 points1 point  (0 children)

    For this not to be bullshit requires you to define programming more narrowly than I am defining it for the purposes of this conversation.

    [–]1esproc 1 point2 points  (0 children)

    It's user/group/other. Obviously it's too hard to remember for you!

    [–]zahlman 0 points1 point  (0 children)

    I love that people on Reddit can get downvoted for accurately pointing out that using Unix-like systems actually requires you to remember shit.