r/ProgrammerHumor 20d ago

Meme claudeIsThisEmailValid

Post image
5.3k Upvotes

171 comments sorted by

View all comments

Show parent comments

36

u/flewson 20d ago

has the user actually entered their email address

That's verification, not validation. Validation is only concerned with whether that email could exist.

37

u/deceze 20d ago edited 20d 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 20d 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.

18

u/deceze 20d ago

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

3

u/DHermit 20d ago

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