News for hackers. Stuff that matters.
Re:Unix as a tool forge (and how Emacs fits in Unix philosophy) by MichaelCollins on Wednesday November 09, 2022 @01:58AM (#33528293)
> Unix is centred around composing lots of individual tools that do one job well.

By this standard, the Unix philosophy has never been realized.

Even when the tools work as advertised, they're hardly doing it well. How do you delete a file called -foo? `rm -- -foo`. Do you know what -- is? It's kludge! It's kludge that needs to exist because Unix's entire paradigm of argument passing is legacy crap.

And historically, the tools didn't even work as advertised. Before GNU came along, there used to be all kinds of hidden landmines in common Unix utilities, like tools which silently truncated long output lines because they were using static buffers instead of dynamic memory allocation. GNU's style guide specifically warns against doing this, because it used to be the Unix status quo. Things like this get left out of the romantic tales of Unix's history, leading newbies to view Unix with rose tinted glasses.

As for "doing one thing", nobody even knows what that means. What is the difference between one thing and two things? Should rm not be able to remove directories because rmdir exists? That's subjective, what qualifies as "one thing" is inherently subjective.

Re:Unix as a tool forge (and how Emacs fits in Unix philosophy) by gw98 on Wednesday November 09, 2022 @02:42AM (#33528501)
Oh completely agree. But the philosophy is spot on. I've applied it to many problems over the years successfully outside the domain of Unix. The reality is however less than ideal.
Re:Unix as a tool forge (and how Emacs fits in Unix philosophy) by bbarnett on Wednesday November 09, 2022 @03:09AM (#33528653)
Agree, but don't like your rm example.

rm -- just means end of args, and it can conveniently be left off. That's not a kludge, it's a feature.

A feature that many command line utils (GNU grep) support.

Re:Unix as a tool forge (and how Emacs fits in Unix philosophy) by legends2k on Wednesday November 09, 2022 @06:20PM (#33539613)
It's kludge since you are special casing for some files and not for others e.g. rm abc vs rm -- -xyz. If Unix utilities had a different form of specifying args which didn't meddle/overlap with file names this kludge wouldn't have to exist.
Re:Unix as a tool forge (and how Emacs fits in Unix philosophy) by bbarnett on Thursday November 10, 2022 @07:14AM (#33545322)
But it isn't a kludge, you are supposed to use it for all files, you are just granted the option of not.
Re:Unix as a tool forge (and how Emacs fits in Unix philosophy) by sgbeal on Wednesday November 09, 2022 @09:02AM (#33531710)
> How do you delete a file called -foo?

rm ./-foo

Re:Unix as a tool forge (and how Emacs fits in Unix philosophy) by legends2k on Wednesday November 09, 2022 @06:44PM (#33539869)
Yeah, but still kludge because we don't do that for all files, do we? If it didn't start with a minus, we'd just drop it. So there's no one true way, as we'd like to think.
Re:Unix as a tool forge (and how Emacs fits in Unix philosophy) by gw98 on Thursday November 10, 2022 @05:57PM (#33554826)
I have never felt the desire to, or accidentally created files with minus at the start.
Re:Unix as a tool forge (and how Emacs fits in Unix philosophy) by legends2k on Wednesday November 09, 2022 @06:28PM (#33539699)
Thanks for your answer. Never realised the overlap between rm and rmdir. Actually the philosophy is a nice guideline but blindly holding on to it for the heck of it is childish. Your comment made me realise that.