this post was submitted on 05 Mar 2025
22 points (95.8% liked)

Programmer Humor

24980 readers
1388 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
 
all 19 comments
sorted by: hot top controversial new old
[–] conditional_soup@lemm.ee 5 points 4 months ago* (last edited 4 months ago) (3 children)

Regex

Edit: to everyone who responded, I use regex infrequently enough that the knowledge never really crystalizes. By the time I need it for this one thing again, I haven't touched it in like a year.

[–] kameecoding@lemmy.world 1 points 4 months ago (1 children)

Most of regex is pretty basic and easy to learn, it's the look ahead and look behind that are the killers imo

[–] PoolloverNathan@programming.dev 1 points 4 months ago

(?=) for positive lookahead and (?!) for negative lookahead. Stick a < in the middle for lookbehind.

[–] Kissaki@programming.dev 1 points 4 months ago (1 children)

You always forget regex syntax?

I've always found it simple to understand and remember. Even over many years and decades, I've never had issues reading or writing simple regex syntax (excluding the flags and shorthands) even after long regex breaks.

[–] Akito@lemmy.zip 1 points 4 months ago

It's not about the syntax itself, it's about which syntax to use. There are different ones and remembering which one is for which language is tough.

[–] 9point6@lemmy.world 1 points 4 months ago

You get used to it, I don't even see the code—I just see: group... pattern... read-ahead...

[–] 0x0@lemmy.dbzer0.com 1 points 4 months ago

PSA: Run ShellCheck on your shell scripts. It turns up a shocking number of programming errors. https://www.shellcheck.net/

[–] MechanicalJester@lemmy.world 0 points 4 months ago (1 children)

I mastered and forgot almost entirely RegEx several times now

[–] SpaceNoodle@lemmy.world 0 points 4 months ago (1 children)

Clearly you don't write enough bash scripts.

[–] CrazyLikeGollum@lemmy.world 0 points 4 months ago (1 children)

Or scripts for basically any other variant of the Bourne shell. They are, for the most part, very cross compatible.

[–] Tinidril@midwest.social 1 points 4 months ago

That's the only reason I've ever done much of anything in shell script. As a network administrator I've worked many network appliances running on some flavor of Unix and the one language I can count on to be always available is bash. It has been well worth knowing for just that reason.

[–] perishthethought@lemm.ee -1 points 4 months ago (1 children)

I don't normally say this, but the AI tools I've used to help me write bash were pretty much spot on.

[–] marduk@lemmy.sdf.org 0 points 4 months ago (1 children)

Yes, with respect to the grey bearded uncles and aunties; as someone who never "learned" bash, in 2025 I'm letting a LLM do the bashing for me.

[–] SpaceNoodle@lemmy.world 1 points 4 months ago (1 children)

Until the magic incantations you don't bother to understand don't actually do what you think they're doing.

[–] MBM@lemmings.world 0 points 4 months ago (1 children)

I wonder if there's a chance of getting rm -rf /* or zip bombs. Those are definitely in the training data at least.

[–] furikuri@programming.dev 1 points 4 months ago

The classic rm -rf $ENV/home where $ENV can be empty or contain spaces is definitely going to hit someone one day