News for hackers. Stuff that matters.
Re:Use Long Options in Scripts by userbinator on Friday March 21, 2025 @11:43PM (#43443250)
Strongly, strongly disagree. This is a GNU-ism, and needlessly verbose. What's with people refusing to use the vast amount of memory in their brains and actually learning, instead lazily going for the lowest-common-denominator approach relying on "loanwords" from English?
Re:Use Long Options in Scripts by mplanchard on Friday March 21, 2025 @11:52PM (#43443307)
Because not everyone has 20 or more years of flag memory from using Linux, and they’ve also got to maintain the scripts. If you’re not familiar with every arcane invocation of find or tar or whatever, or even if it’s just been a while, the long options are a godsend when you’re skimming a script trying to figure out what it’s doing.
Re:Use Long Options in Scripts by userbinator on Saturday March 22, 2025 @02:37AM (#43443990)
Because not everyone has 20 or more years of flag memory from using Linux

It's called learning, apparently something that is now being eschewed in favour of quick superficiality (and making developers more replaceable --- with AI or unskilled offshore labour.) No wonder "modern" software is almost always total shit.

"But I don't have the time to learn," you complain, but ask yourself this instead: Why do you never have the time to do it right, but always the time to do it twice (or however many times is necessary to get a barely-working product)?

Re:Use Long Options in Scripts by pcwalton on Saturday March 22, 2025 @03:30AM (#43444178)
I’m nostalgic about old Unix too, but it’s just that: nostalgia. In reality, Unix was the system that brought us such elegant well-designed APIs as gets(3) and strtok(3).
Re:Use Long Options in Scripts by biorach on Saturday March 22, 2025 @03:14AM (#43444134)
You're confusing learning with memorization.
Re:Use Long Options in Scripts by userbinator on Saturday March 22, 2025 @05:51AM (#43444602)
It's the lowest, easiest level of learning.
Re:Use Long Options in Scripts by hackerthemonkey on Saturday March 22, 2025 @06:20AM (#43444738)
Exactly that. Well said. I can control my learning but memory? Not as much.
Re:Use Long Options in Scripts by 9dev on Saturday March 22, 2025 @04:25AM (#43444347)
How does it work for you in practice? Nobody can contribute to the code base until they have grown into grumpy greybeards, after years of feeling stupid and inadequate? So they can finally write code that is complicated and can only understood by other experts, because code is complicated and supposed to be used by experts only?

I’m so glad I don’t have someone like you on my team.

Re:Use Long Options in Scripts by userbinator on Saturday March 22, 2025 @05:44AM (#43444583)
Everyone learns as they go, including me. I actually make use of the thing inside my head, which I'm being paid to use. There's nothing "complicated" about a bit of memorisation.

Imagine a pilot, plumber, or electrician not wanting to learn the language of the trade. No other profession I know of is as self-destructive to intelligence as the software industry.

I’m so glad I don’t have someone like you on my team.

I don't want lazy brainless losers either, because that's what you're advocating for.

Re:Use Long Options in Scripts by 9dev on Saturday March 22, 2025 @07:35AM (#43445057)
Nobody here was advocating against learning and memorising, but for writing code that is as self-evident and unambiguous as possible.

Talk to any electrician which kinds of diagrams they prefer; those were a fellow was clever, trying to compress stuff as much as possible, or those that are clearly readable and easy to understand. Pilots carry heaps of documentation with them on the plane, walk through checklists instead of trying to memorise what to do. Your argument doesn’t hold up the slightest scrutiny.

I’m advocating for a culture of helping people hone their skills by learning from others instead of being turned off by their arrogance. That’s a very different thing from encouraging them to avoid thinking.

Re:Use Long Options in Scripts by olejorgenb on Saturday March 22, 2025 @06:16AM (#43444715)
Learning that this tool can be used do these things, manipulate these objects or stream of data like this, and that this tool is useful in combination with these other tools are the valuable part. Memorizing some arbitrary encoding of the parameters are not really useful when I can offload it to my language center in the brain and basically get that part for free...
Re:Use Long Options in Scripts by skydhash on Saturday March 22, 2025 @08:12AM (#43445213)
Why do you conflate learning with memorizing? man <command> is easy to do. And you take notes, write script, functions and alias for things you do often.
Re:Use Long Options in Scripts by hackerthemonkey on Saturday March 22, 2025 @06:19AM (#43444734)
Learning is one thing and being able to comprehend a piece of code at a glance is another. I might know them but wouldn’t immediately remember all the past and future short form of flags ever written. What is even the point of that? If I am comfortable with the essence of what they do, does it really matter that much if I have that ingrained in my memory that -r does foo while -f does bar?
Re:Use Long Options in Scripts by JimDabell on Saturday March 22, 2025 @08:53AM (#43445388)
I’ve got almost 30 years of using UNIX shells and I’ve learnt a lot more than most, but there are plenty of tools that have things like -r and -R that do radically different things and I don’t always remember the difference between them. If it’s written --recursive then it’s a lot clearer. Clarity is useful even when you have a lot of knowledge and experience.
Re:Use Long Options in Scripts by mplanchard on Saturday March 22, 2025 @10:57AM (#43446119)
As someone who works on a team of people with different levels of experience, where understanding is more important than some self-inflicted purity test of their unix chops, I will always either do long options or, where that’s not possible, a comment explaining the short options.

No one is complaining about not having time to learn: you’re arguing against a strawman. The point is not to discourage learning, it’s to encourage clarity in a context where it can at times be critically important.

Re:Use Long Options in Scripts by tannhaeuser on Saturday March 22, 2025 @02:43AM (#43444009)
No the problem is to overload utilities with hundreds of options and subcommand languages over the course of decades. The starting point was quick command-line usage but GNU-style long options are clearly rooted in Elisp/emacs hyphenated-words-verbosity. You can tell it wasn't meant to be like this when typing somecmd -h results in multiple pages of option output where you can't see the forrest for the trees, and the command's manpage similarly loosing its usefulness due to sheer size, and frequently not even containing an EXAMPLES section. If it has a manpage in the first place, rather than linking to a nonexistant texinfo page like was practice for the longest time. All of which make you none the wiser so you go to the web for example usage.
Re:Use Long Options in Scripts by xyzzy9563 on Saturday March 22, 2025 @09:57AM (#43445665)
You can always copy+paste it into an LLM and have it explain the options in 5 seconds.
Re:Use Long Options in Scripts by mplanchard on Saturday March 22, 2025 @10:59AM (#43446144)
I like how programmers are all about locality of reasoning and avoiding context switches until the context switch is “go paste it into an LLM”
Re:Use Long Options in Scripts by xyzzy9563 on Saturday March 22, 2025 @11:01AM (#43446157)
Just wait 5 years when 99% of code is written by LLM agents.
Re:Use Long Options in Scripts by timewizard on Saturday March 22, 2025 @02:33PM (#43447607)
I just use the man page. Which happily describes all the options in an easily digestible format that does not require either an ineternet connection or massive amounts of power to be wasted on a result that is almost certainly copyrighted and flat out stolen from it's original creator.

I am of a generation where I see these uses of LLMs as exceptionally lazy or showy. Your ready use of a "chatbot" is not an attribute to broadcast like this.

Re:Use Long Options in Scripts by 01HNNWZ0MV43FF on Saturday March 22, 2025 @12:42AM (#43443616)
Programs are read more often than they're written, and on a scale of decades all programmers are novices. So I try to optimize my code to be obvious to novices

What's wrong with GNU? they automatically wrong or something?

Re:Use Long Options in Scripts by userbinator on Saturday March 22, 2025 @02:35AM (#43443976)
So I try to optimize my code to be obvious to novices

That's the attitude which is responsible for making software the way it is today: mediocre.

Re:Use Long Options in Scripts by cedilla on Saturday March 22, 2025 @08:56AM (#43445403)
Software is mediocre today? You should have seen it back in the day. It was a brittle, arcane mess.

Software isn't as exciting any more, but that excitement isn't gone because newbs don't have to look up what -O stands for anymore. It's because it's wildly more reliable.

Re:Use Long Options in Scripts by wruza on Saturday March 22, 2025 @07:07AM (#43444953)
I low key agree on this, because I think it doesn’t matter and you have to look up the meaning anyway. English-like options may make you think you already know the details but usually you don’t. If there’s a need to develop in sh/bash/etc, then a modern solution would be to make something like a language server for it which could “go to definition” right into a man page section, or combine docs for all used options in a single popup/aux window. Of course it’s not possible for every man page, since some of these are written in too free form. Iow, it’s shell, whatever you program here in more than two lines you’d better program in python instead (and I’m saying this as a low key python hater).