Live data from Hacker News

How not to check the validity of an email address

dellsystem.me

241–243 of 243 posts

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

#241
post #240

Earlier quoted context omitted.

The point is that using (a == true) instead of a is idiotic. Now, there are good semantic reasons to use (a == true) in some languages, but we're not talking about that, we're talking purely about style. It's no different from doing (a && true) or (i + 0) or (f * 1.0) when a, i and f would suffice. Not only is it longer, it forces you to stop and think, was there a good reason why this was being done? Can a hold trut…

> In almost all cases, it's a holdover from someone going in their head "if a is true" (because "if a" doesn't read well in human languages) and writing that out, It's interesting you admit that people are doing it "the long way" because that's how it naturally flows out of their head. Doesn't it make sense that it would naturally flow into their head the same way? What's the goal here - write very tight, concise cod…

I was describing first-year students who are reading code as though it's written in a foreign language, not anyone with some degree of competence. For obvious reasons, professionals should not be internally verbalizing as they write or read code, any more than a fluent French speaker should be internally translating from English as they speak French.

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

#242
post #102

there is a huge market (education and higher education) where institutions (sometimes governments) will pay huge money for these sorts of apps, and for whatever reason, the only real players are often of this quality at my university we use a similar system called OWL, which replaced a system called Web-CT. Both are horrendously slow, with fantastically poorly thought out interfaces. There is a ton of money to be mad…

How ironic that you mention WebCT, because that's what McGill in the article uses until very recently.

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

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

[deleted]
Post reply on HN