Live data from Hacker News

How not to check the validity of an email address

dellsystem.me

181–190 of 243 posts

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

#181
post #15

Clearly they should have optimized this by stripping the @mail.mcgill.ca on the server side before serving the list.

You know, for all the ridiculousness of this code, at least it actually performed its function correctly, i.e. it would correctly identify all McGill email addresses. From the title I was expecting another multi-page regexp.

Unless a new user was added after that page was loaded.

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

#182

Earlier quoted context omitted.

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.

Maybe, but I'd worry that they're only suggesting that because the appcache can be a pain to work with. localStorage is synchronous, and so putting huge amounts of data in there can delay page load.

AppCache is a pain to work with.

Admittedly, when I was working on it, we were trying to wrangle it into something it really wasn't meant to do, but that fact - that it wasn't a good fit for our application - wasn't at all obvious until I finally started encountering all the "gotchas", and reading more about them.

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

#183
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.

Certainly that solution would have avoided this whole fiasco in the first place. Though immediate user feedback when entering an invalid email address is a somewhat useful feature as well, so maybe that's why the vendor included it.

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

#184

Earlier quoted context omitted.

This story almost had me in tears (a mix of schadenfreude and shame for my profession). I hope they learned something not to give business critical work to college students. Makes me think that IT Risk management should be right at the top of what MBAs have to learn.

I agree with the sentiment, but in this particular case, do you really think an MBA'd IT manager was in charge of a project that paid $20 per hour? (As opposed to Accenture rates.)

No, I don't think so. On the other hand I do know a case with MBA type manager who gave away the job of doing their website to a complete amateur, just because he knew him. So it wouldn't surprise me either to be honest.

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

#186

Earlier quoted context omitted.

So, you changed a somewhat reproducible bug into one that has about a four billion times lower chance of occurring? Good luck to the poor chap who will have to figure out what happened when that bug hits. Also, you introduced a new error condition: a corrupt packet that should set a value of 1, but arrives as a value of 2 will not initiate the landing routine. The right thing to do, IMO, is to prevent corrupt data pa…

> So, you changed a somewhat reproducible bug into one that has about a four billion times lower chance of occurring? Yes. You seem to imply that's a bad thing? > Also, you introduced a new error condition: a corrupt packet that should set a value of 1, but arrives as a value of 2 will not initiate the landing routine. A corrupt packet should not do anything, so that's good, not an error. We do not want the landing r…

It was a bad thing, the way you described it. Now that I know you also fixed the root cause of the problem, I can see it as an additional line of defense.

I think I wouldn't add it, though. Time is better spent on tooling that checks the variable doesn't get an incorrect value.

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

#187
post #173

Earlier quoted context omitted.

Why stop there? To really get the point across, you may want to do: if (((((a == true) == true) == true) == true) == true) That way, you can be even more certain!

Potentially, I can construct an independent statement to adequately convey my innervation to your statement of factual basis, that while being grammatically correct, purposefully adds needless complexity to the original statement of intent I am adequately attempting to convey. Should I?

What are you talking about?

If it's somehow clearer to say if (x == true) instead of if (x), why isn't it also clearer to say if ((x == true) == true) instead of merely if (x == true)? And so on?

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

#188

I'm sad to see so many smart people wasting their time discussing what some stupid person did. :( I'm also disappointed I lost a couple of minutes of my life reading about this stupidity as well... just because it got 233 points. So, I'm looking at YOU 233 who upvoted this. WHY DID YOU DO IT?

As expected. :) Just click the downvote button on my comment. Don't bother to explain anything. Oh, I know, you disapprove I called you smart. Sorry about that.

I've been on HN for a while (lurking), never seen a downvote button but here people referencing them on occasion. Why do I not see downvote buttons? Or is this some inside joke?

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

#189
post #136

Earlier quoted context omitted.

I thought the fake delays were so the programmer could cash in on doing optimisations at a later date.

Also, your ads are viewed for more seconds = more revenue

Those two things are just added bonuses!

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

#190

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…

> I don't know what the deal is, but a huge proportion of people writing code are plain incompetent.

Hooray for short term job security!

Post reply on HN