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

Programmer Humor

27690 readers
357 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
 

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 1 week ago (1 children)

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

[–] excess0680@lemmy.world 2 points 1 week ago (1 children)

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

[–] ulterno@programming.dev 1 points 1 week ago (1 children)

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 1 week 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.