this post was submitted on 05 Mar 2025
1520 points (99.0% liked)

Programmer Humor

20954 readers
2993 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 18 points 1 day ago* (last edited 1 day ago) (3 children)

That's why I use nushell. Very convenient for writing scripts that you can understand. Obviously, it cannot beat Python in terms of prototyping, but at least I don't have to relearn it everytime.

[–] AnUnusualRelic 23 points 1 day ago (4 children)

So the alternative is:

  • either an obtuse script that works everywhere, or
  • a legible script that only works on your machine…
[–] shortrounddev 5 points 21 hours ago (3 children)

I am of the opinion that production software shouldn't be written in shell languages. If it's something which needs to be redistributed, I would write it in python or something

[–] [email protected] 1 points 5 hours ago

On a more serious note, NOTHING with more than a little complexity should be written in shell scripts imo. For that, Python is the best, primarily due to how fast it is to prototype stuff in it.

[–] [email protected] 2 points 15 hours ago (1 children)

I tend to write anything for distribution in Rust or something that compiles to a standalone binary. Python does not an easily redistributable application make lol

[–] shortrounddev 2 points 15 hours ago* (last edited 15 hours ago)

Yeah but then you either need to compile and redistribute binaries for several platforms, or make sure that each target user has rust/cargo installed. Plus some devs don't trust compiled binaries in something like an npm package

[–] AnUnusualRelic 4 points 19 hours ago (1 children)

For a bit of glue, a shell script is fine. A start script, some small utility gadget...

With python, you're not even sure that the right version is installed unless you ship it with the script.

[–] shortrounddev 2 points 19 hours ago (1 children)

I try to write things to be cross-platform; with node builds, I avoid anything using shell scripting so that we can support Windows builds as well. As such, I usually write the deployment scripts in Node itself, but sometimes python if it's supported by our particular CI/CD pipeline

[–] AnUnusualRelic 3 points 18 hours ago (1 children)

I keep forgetting windows exists.

[–] shortrounddev 1 points 18 hours ago (1 children)

Most common development platform in the world

[–] AnUnusualRelic 2 points 18 hours ago (1 children)

I quit using it in the WfW days and never looked back.

[–] shortrounddev 1 points 18 hours ago* (last edited 18 hours ago) (1 children)

You haven't used windows in like 30 years? It's quite different now lol

[–] AnUnusualRelic 2 points 18 hours ago

Maybe. I'm fine with my Linux machines though.

[–] [email protected] 3 points 20 hours ago

a script that only works on your machine

That's why docker exists :D

[–] SwordInStone 4 points 23 hours ago* (last edited 23 hours ago)

Ruby and calling bash like this

`cat a.txt`
[–] [email protected] 11 points 1 day ago (2 children)

Nu is great. Using it since many years. Clearly superior shell. Only problem is, that it constantly faces breaking changes and you therefore need to frequently update your modules.

[–] [email protected] 4 points 1 day ago

Not a problem for me in Nix, seems like a skill issue ~/j~

[–] [email protected] 2 points 1 day ago (2 children)

They’ve slowed down with those a bit recently, haven’t they?

[–] [email protected] 3 points 20 hours ago (1 children)

Yesterday, I upgraded from 0.101.0 to 0.102.0 and date to-table was replaced equally (actually better) with into record, however it was not documented well in the error. Had to research for 5 to 10 minutes, which does not sound much, but if you get this like every second version, the amount of time adds up quickly.

[–] [email protected] 1 points 20 hours ago (1 children)

Actually had been deprecated beforehand, you should have gotten a warning. The deprecation cycle certainly is quite short, I'm still on 0.100.0, If I were to upgrade now I'd jump the version with the warning.

[–] [email protected] 1 points 20 hours ago

Yes, I switched to an older version and there was the warning. However, there was no warning on 0.101.0 whatsoever, so upgrading just one patch version broke my master module.

Sometimes, I skip some versions, so I am certain, that I jumped from < 0.100.0 straight to 0.101.0 and here we are, without any deprecation warning.

[–] [email protected] 3 points 23 hours ago* (last edited 23 hours ago) (1 children)

Not really. They've been on the stabilising path for about two years now, removing stuff like dataframes from the default feature set to be able to focus on stabilising the whole core language, but 1.0 isn't out yet and the minor version just went three digits.

And it's good that way. The POSIX CLI is a clusterfuck because it got standardised before it got stabilised. dd's syntax is just the peak of the iceberg, there, you gotta take out the nail scissors and manicure the whole lawn before promising that things won't change.

Even in its current state it's probably less work for many scripts, though. That is, updating things, especially if you version-lock (hello, nixos) will be less of a headache than writing sh could ever be. nushell is a really nice language, occasionally a bit verbose but never in the boilerplate for boilerplate's sake way, but in the "In two weeks I'll be glad it's not perl" way. Things like command line parsing are ludicrously convenient (though please nushell people land collecting repeated arguments into lists).

[–] [email protected] 1 points 20 hours ago

Fully agree on this. I do not say, it's bad. I love innovation and this is what I love about Nushell. Just saying, that using it at work might not always be the best idea. ;)

[–] [email protected] 1 points 22 hours ago

We have someone at work who uses it and he's constantly having tooling issues due to compatibility problems, so.. yeah.

I'm sure it's fine for sticking in the shebang and writing your own one-off personal scripts, but I would never actually main it. Too much ecosystem relies on bash/posix stuff.