I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
isEmail sounds weird because it's too generic. For most purposes you'll be validating a user's input, and if they put in foo@example.com that may be a valid email address but it's not valid for use as such in the context of your app.
Not listed, but I would use
isValidEmail
.is*
is a good way to indicate true/false return value. Andif (isValidEmail)
reads well.I would not use
validateEmail
because I would expect an error message in return, not a boolean.I would not use
isEmail
because it sounds weird and unclear to me. I can’t put my finger on why though.I would not use
emailIsValid
because I assume there would be a series of functions like this, and I would like their names to all start same.isEmail
sounds weird because it's too generic. For most purposes you'll be validating a user's input, and if they put infoo@example.com
that may be a valid email address but it's not valid for use as such in the context of your app.isValidEmail
added. Thanks for the feedback.