Expressions

14 days ago by Buage_ to c/programmer_humor

akunohana 30 points 14 days ago

NHVJZ5nGtsRSDaD.jpg

path: 0 26063101, hotness: undefined, score: 30, children: 0
rockSlayer 27 points 14 days ago

path: 0 26064532, hotness: undefined, score: 27, children: 0
Aatube 15 points 14 days ago

none of the meat of the regex shown, 0/10

path: 0 26063968, hotness: undefined, score: 15, children: 2
PumaStoleMyBluff 12 points 14 days ago

Probably because showing your email regex publicly is a great way to get 1000 messages about obscure edge cases you're not handling πŸ˜›

path: 0 26063968 26066072, hotness: undefined, score: 12, children: 0
whats_a_lemmy 5 points 14 days ago

One star. Too readable, would not write again

path: 0 26063968 26064767, hotness: undefined, score: 5, children: 0
aMockTie 12 points 14 days ago

Why waste time doing any matching if wantarray == false? Just do:

if(!wantarray) { return 1; }

Before any matching happens, or if you only want one return statement set the value of a variable in if(!wantarray)/elsif(regex) and return that variable at the end.

path: 0 26063409, hotness: undefined, score: 12, children: 1
marcos 11 points 14 days ago

That Perl. You never know if return doesn't have some kind of hidden behavior that uses the local variables...

Well, you could read the perldoc page on it. But you can't just assume it.

path: 0 26063409 26063985, hotness: undefined, score: 11, children: 0
death_to_carrots 7 points 14 days ago

If regular expressions are your solution, than your problem is wrong.

path: 0 26063650, hotness: undefined, score: 7, children: 3
daychilde 5 points 13 days ago

Some people, when confronted with a problem, think, β€œI know, I'll use regular expressions.”

Now they have two problems.

path: 0 26063650 26067607, hotness: undefined, score: 5, children: 1
jjj 7 points 13 days ago

Counterargument: ctrl+f is a great place for regex. Write once read never problems are a great application for unreadable languages. Imagine if people wrote scripts in the language vi uses for editnigbceediting, which mostly isn't even displayed as it's typed!

But yeah, it's kind of terrible for anything else.

path: 0 26063650 26067607 26068637, hotness: undefined, score: 7, children: 0
themaninblack 2 points 13 days ago

Should be at the top.

path: 0 26063650 26071966, hotness: undefined, score: 2, children: 0
MaggiWuerze 6 points 14 days ago

That's just sad expression with extra steps

path: 0 26064804, hotness: undefined, score: 6, children: 0
naeap 5 points 14 days ago

At least the cat is happy again now after getting adopted

I'll forever be sad trying to understand the regex I've written myself...

path: 0 26064913, hotness: undefined, score: 5, children: 0
sit 4 points 14 days ago

Doggy is not smiling but trying to lose heat. Doggy is the real regular expression

path: 0 26064636, hotness: undefined, score: 4, children: 1
janus2 2 points 13 days ago

similarly, cats don't usually express emotions with their face (and often don't express them at all)

path: 0 26064636 26071684, hotness: undefined, score: 2, children: 0
programmer_humor
programmer_humor

@programming.dev

login for more options
33571
2550
7101

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

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
    • If the mod doesn't find it funny, you're banned. Ha-ha!... For real: do not use the community for "statements". There are other places for such content. Keep it chill and funny.

go to feed...