653
functions (lemmy.ml)

cross-posted from: https://lemmy.ml/post/39334581

you are viewing a single comment's thread
view the rest of the comments
[-] ulterno@programming.dev 6 points 3 weeks ago

While C feels fine without having a keyword for function, I feel like bash would have benefitted from it.

[-] excess0680@lemmy.world 2 points 3 weeks ago

Bash (specifically Bash, not POSIX sh) does have a keyword for functions (function), but it’s optional.

[-] ulterno@programming.dev 1 points 3 weeks ago

Ooh nice.

The optional bit messed it up, because even though I can make my scripts easier for me, other's scripts won't be.
But then bash had to be usable with sh scripts, so I get it.

[-] excess0680@lemmy.world 2 points 3 weeks ago

Right. It’s optional so that Bash remains backwards compatible as a superset of POSIX sh. If you’re working with exclusively Bash, though, it’s nice to use as syntactic sugar if nothing else.

this post was submitted on 22 Nov 2025
653 points (98.7% liked)

Programmer Humor

27934 readers
1943 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