this post was submitted on 17 Jan 2026
68 points (91.5% liked)
Technology
78829 readers
2600 users here now
This is a most excellent place for technology news and articles.
Our Rules
- Follow the lemmy.world rules.
- Only tech related news or articles.
- Be excellent to each other!
- Mod approved content bots can post up to 10 articles per day.
- Threads asking for personal tech support may be deleted.
- Politics threads may be removed.
- No memes allowed as posts, OK to post as comments.
- Only approved bots from the list below, this includes using AI responses and summaries. To ask if your bot can be added please contact a mod.
- Check for duplicates before posting, duplicates may be removed
- Accounts 7 days and younger will have their posts automatically removed.
Approved Bots
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
The point I'm making is that bash is optimized for quickly writing throwaway code. It doesn't matter if the code written blows up in some case other than the one you're using. You don't need to handle edge cases that don't apply to the one time that you will run the code. I write lots of bash code that doesn't handle a bunch of edge cases, because for my one-off use, that edge case doesn't arise. Similarly, if an LLMs is generating code that misses some edge case, if it's a situation that will never arise, and that may not be a problem.
EDIT: I think maybe that you're misunderstanding me as saying "all bash code is throwaway", which isn't true. I'm just using it as an example where throwaway code is a very common, substantial use case.
I still don't get what you mean, sorry. And why Bash and not another shell?
Why not Korn, Ash, Dash, Zsh, Fish, or anything REPL, including PHP, Perl, Node, Python etc.
Should we consider "throwaway" anything that supports interactive mode of your daily driver you chose in your default terminal prompt?
What does "throwaway" code means in the first place?
I.... think they might be misusing the word "bash"? Maybe?
Yeah, I went back through this reply chain and I couldn't find any explicit evidence that they're talking about shell scripting at all, and perhaps think that the "bash programming language" refers to a general style, i.e. "to bash stuff together until it works".
I chose it for my example because I happen to use it. You could use another shell, sure.
Interactive mode is a good case for throwaway code, but one-off scripts would also work.
If you want to actually realize the amount of possible misunderstanding in the current conversation and of what shell scriting is, please do consider joining
#bashat Libera IRC. Please do also mention the word "throwaway" in the rooms! Since there's literally no understanding on what you mean still, sorry. It does not feel like you have a significant enough understanding of the subjects raised.For a very simple example, there are literally no documentation regarding certain cases you'll encounter in Bash's built-ins even, unless you actually encounter it or learn from Bash's very source code, like
readbuilt-in. Not to mention shenanigans in shell logics for inter-process communication (IPC), file-descriptors, environment variables likePWD, exported functions'BASH_FUNC_, pipes, etc.