this post was submitted on 18 Aug 2025
661 points (99.1% liked)

Programmer Humor

25776 readers
2194 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
[–] TomasEkeli@programming.dev 26 points 7 hours ago (1 children)

I don't validate emails, I test them.

That's your email? OK, what did we send it? if we couldn't send to it or the user can't read it there's no reason to accept it.

OK, maybe I do some light validation first, but I don't trust the email address just because it's email-address-shaped.

[–] ChaoticNeutralCzech@feddit.org 5 points 7 hours ago (2 children)

What kind of "light validation"? I'm guessing a .*@.* regex match.

[–] TomasEkeli@programming.dev 9 points 7 hours ago* (last edited 6 hours ago) (2 children)

Almost correct. ^.+@.+$

Too hard to validate properly to be worth it. Even if it is technically valid that's insufficient. It must also work, and the easiest way to test that is to use it and verify that the user got what we sent.

[–] qaz@lemmy.world 1 points 2 hours ago (1 children)
[–] TomasEkeli@programming.dev 1 points 15 minutes ago

Would pass first validation, but fail when we try to send an email.

Successfully failed.

[–] GreenKnight23@lemmy.world 3 points 5 hours ago (1 children)

I see you accept lemmy handles.

[–] TomasEkeli@programming.dev 6 points 5 hours ago

if i can email them and the user gets it - fine by me

[–] qqq@lemmy.world 6 points 7 hours ago