Live data from Hacker News

How not to check the validity of an email address

dellsystem.me

81–90 of 243 posts

Re: How not to check the validity of an email address

#81

For me it depends on what "validity" means. 1.) Prevent typos etc. Regex or Mailgun or Kicksend is enough. 2.) Prevent bounces, prevent wrong signups one needs to do double opt in.

The article has nothing to do with this aspect of address validation

Re: How not to check the validity of an email address

#82
post #68
post #48

Earlier quoted context omitted.

> hiring random "programmers" who have history or psychology degrees and think they can program because they made a form in PHP. That's pretty unfair to people coming from history or psychology who actually can write good code. Just because you don't have a degree in CS doesn't mean your code is shit. This is purely anecdotal, but my predecessor at my current job was a CS graduate and wrote code like in the OP.

Here here. There are plenty of people who have CS degrees and can't programme. Why else do we need "FizzBuzz".

It's "hear, hear!" - an abbreviation of "Hear him, hear him!".

Re: How not to check the validity of an email address

#83
post #81

For me it depends on what "validity" means. 1.) Prevent typos etc. Regex or Mailgun or Kicksend is enough. 2.) Prevent bounces, prevent wrong signups one needs to do double opt in.

The article has nothing to do with this aspect of address validation

1.) Yes, the article was about choosing the right approach for validation

2.) I urge developers to step back and think about the requirements they get. Concerning those I would have thought what validity in this situation means, e.g. light validation in JS, send validation / validation list on the server etc.

Re: How not to check the validity of an email address

#85
post #65

Earlier quoted context omitted.

I've seen a surprising amount of code that does: if (aBoolean == true) { .... }

Typically that isn't done from ignorance, just some (imho misguided) idea about readability.

I saw this in some coding standard for PHP.

Re: How not to check the validity of an email address

#86
post #43
post #40

Gosh. For some reason, the "right answer" I expected to see was "do not try to validate the address; just send the e-mail and handle the bounce if it fails". There is a whole other layer which is very good at handling incorrect or undeliverable addresses.

Not sure you read the article - there is an additional constraint in that only email addresses pertaining to the institution in question are allowed.

Checking against the two viable email endings and handling bounces should they occur is reasonable. It wouldn't give the immediate user feedback though in case of spelling error etc.

Re: How not to check the validity of an email address

#87

Earlier quoted context omitted.

I recently sat in on a presentation regarding javascript module loading. Someone in our company had taken it upon themselves to roll their own solution, because, shit, they're being paid and apparently have no oversight. The solution involved creating an entire cache/hash layer on the client using local storage. At the end of the presentation I had to try to be as respectful as possible when I asked why basic browser…

So they had used HTML5 local storage and missed the fact that HTML5 has a pretty nice offline caching feature?

Don't judge them too harshly. I am currently developing web app with offline capabilities. FT which provide the scaffolding code recommend using the cache manifest only for the absolutely minimum requirements (jquery + 10 lines of html) and use local storage for all the rest.

I suppose they know what they are talking about.

Re: How not to check the validity of an email address

#88
post #77

Earlier quoted context omitted.

Unless it's clearly stated sarcasm gets garbled over the wire. So in the hope of helping those who don't get it I decided to do the right thing just to be on the safe side. ;)

From now on, when you see a post taking the form "Clearly [obviously bad idea]", please read it out loud in The Simpson's Comic Book Guy voice and place extra emphasis on the irony. This ensures you will get the correct intent 99% of the time.

Clearly, acting like a dumbfuck in order to become enlightened is obviously the right thing to do.

Re: How not to check the validity of an email address

#89
post #48

Every single legacy application I've ever worked on has had analogous code buried in it somewhere. An application I've just been "repairing" recently has a spot where it uses two separate queries to pull two full table sized lists of values, then manually joins them with a loop, and then manually re-orders the joined values into groups selectively ignoring some rows, and then embeds the the whole reordered list in a…

> hiring random "programmers" who have history or psychology degrees and think they can program because they made a form in PHP. That's pretty unfair to people coming from history or psychology who actually can write good code. Just because you don't have a degree in CS doesn't mean your code is shit. This is purely anecdotal, but my predecessor at my current job was a CS graduate and wrote code like in the OP.

As a history major, I would agree with you.

One of the real issues has to do with the mentality of coding. There are people regardless of background who approach coding as a job, and those who approach it as a craft. You want the latter, not the former.

Here's my rule:

If you don't look back at code you wrote a decade ago with some degree of horror, you are either an extraordinarily good coder, or you aren't a good coder at all.

Re: How not to check the validity of an email address

#90
post #48

Earlier quoted context omitted.

> hiring random "programmers" who have history or psychology degrees and think they can program because they made a form in PHP. That's pretty unfair to people coming from history or psychology who actually can write good code. Just because you don't have a degree in CS doesn't mean your code is shit. This is purely anecdotal, but my predecessor at my current job was a CS graduate and wrote code like in the OP.

As a history major, I would agree with you. One of the real issues has to do with the mentality of coding. There are people regardless of background who approach coding as a job, and those who approach it as a craft. You want the latter, not the former. Here's my rule: If you don't look back at code you wrote a decade ago with some degree of horror, you are either an extraordinarily good coder, or you aren't a good c…

A decade is a long time at a single job... Try six months for a good start :)
Post reply on HN