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.
How not to check the validity of an email address
181–190 of 243 posts
Re: How not to check the validity of an email address
#182Earlier 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.
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
#183Gosh. 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.
Re: How not to check the validity of an email address
#184Earlier 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.)
Re: How not to check the validity of an email address
#185Am I the only one who thinks that the amount of flaming is kind of unproductive?
Re: How not to check the validity of an email address
#186Earlier 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…
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
#187Earlier 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?
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
#188I'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.
Re: How not to check the validity of an email address
#189Re: How not to check the validity of an email address
#190Every 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…
Hooray for short term job security!