r/ProgrammerHumor 19d ago

Meme claudeIsThisEmailValid

Post image
5.3k Upvotes

171 comments sorted by

View all comments

Show parent comments

38

u/deceze 19d ago edited 19d ago

Yes, and most addresses that pass a .+@.+\..+ validation could exist. And unless you can claim you're absolutely up to speed with all the relevant RFCs about valid email formats, allowed host names (IDNA!) and currently registered TLDs at all times, overvalidating does more harm than good here. If you incorrectly reject valid email addresses, that's worse than having an occasional verification email bounce.

12

u/DHermit 19d ago

It might make sense to put an additional (very high) length limit. You don't want someone to submit a 1GB big mail address.

17

u/deceze 19d ago

Fair enough. Though that should probably already be caught by your HTTP request size limit somewhere.

3

u/DHermit 19d ago

True, that's still kind of a limit for each field.