:: Re: [DNG] [OT] bash / quote weirdne…
Inizio della pagina
Delete this message
Reply to this message
Autore: Steve Litt
Data:  
To: dng
Oggetto: Re: [DNG] [OT] bash / quote weirdness
Simon said on Thu, 13 Jan 2022 18:38:56 +0000

>Steve Litt <slitt@???> wrote:
>
>> This is one reason why, in shellscripts, you
>> need to quote almost all variables: So they act correctly with the
>> space laden filenames that windows dwoobydogs just love to create.
>
>Not just Windows users. I regularly use spaces in file names.
>
>There’s an argument that computers should be tools, not slavemasters.
>I’m sure you’ll remember going back a few decades how interacting with
>computers meant that the human had to learn how to deal with the
>computer’s way of doing things.


The preceding is true to a great extent. But not a total extent.
There's a tradeoff between user friendly and program simplicity. I
don't think substituting underscores for spaces **in filenames** is a
substantial inconvenience for the user.

[snip]

>Similarly with file names. Once upon a time the human had to adapt to
>what the computer supported - such as fitting your entire file name
>into 8 characters.


But that kind of restriction isn't being discussed here. It's a
strawman.

> Now the computer (mostly) supports what is natural
>for a human - and that includes using spaces in their writing.
>After_all_it_does_seem_a_bit_un-natural_not_being_allowed_to_use_spaces_in_your_writing_-_it_would_make_a_hard_to_read_book_!


We're not talking about books. Or text files. Or anything except
filenames. Very_few_people_make_filenames_this_long, and if they do,
with a little practice it's pretty easy to use underscore instead of
space.

As long as we're strawmanning, let's go all the way. Instead of issuing
"file not found" when a filename isn't found, we can include an AI
module in every program that decides what the user *really* meant when
typing in the filename. It can analyze every filename on the computer,
perhaps look at its contents, and then decide which the user really
wanted, and open that one. Or, if the file is clicked from a file
manager type interface, the AI can analyze all similarly named files in
that directory and others, and issue an "Are you sure" with ranked
choices of other possibilities.

My point is that sure a computer should be more of a tool than a
slavemaster, but it's a tradeoff, not an absolute. There's a spectrum.

Programming around every conceivable filename increases software
complexity. Let's not forget that simplicity and small attack surface
are assets.

One more thing: One person's "user friendly" is another person's "user
hostile". The "we do it all for you" interface aiding the person not
willing to bend at all to the machine is the "we get in your way"
interface for the person who wants to bend the machine to his/her
workflow.

SteveT

Steve Litt
Spring 2021 featured book: Troubleshooting Techniques of the Successful
Technologist http://www.troubleshooters.com/techniques