Live data from Hacker News

How not to check the validity of an email address

dellsystem.me

201–210 of 243 posts

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

#201

Earlier quoted context omitted.

Needs disrupting

It's extremely hard to break into because like healthcare these gigantic institutions where nobody can get fired made choices ten to twenty years ago that have now become "the way it's done" and they won't accept a better solution.

In fairness, my university changed systems every year or so while I was there. They all sucked, so sticking with your existing solution is possibly not the worst decision.

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

#202

Earlier quoted context omitted.

Needs disrupting

It's extremely hard to break into because like healthcare these gigantic institutions where nobody can get fired made choices ten to twenty years ago that have now become "the way it's done" and they won't accept a better solution.

In fairness, my university changed systems every year or so while I was there. They all sucked, so sticking with your existing solution is possibly not the worst decision.

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

#203
post #199

Earlier quoted context omitted.

There's grey zone and there's being obtuse. We're not talking about fancy tricks here - the clearest way to retrieve the truth value of a boolean variable is to refer to it directly, not comparing it for equality against a constant.

That might be the clearest way for you to write it today, though I'm talking about it being clear for someone else to read many years from now. As so many posts on HN have said lately; writing code is easy, it's the reading that's difficult.

How is if (x == true) easier to read than if (x)? Deliberate obtuseness makes things harder to read.

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

#204
post #6

Earlier quoted context omitted.

>The most frustrating part was not the code but the developers reaction to why it was so bad. He had no idea what the big deal was and thought I was being nitpicky. This is always the worst. I've had experiences like that on many an occasion, where the person is simply like "huh? what's wrong?" You can't really fix that level of sheer incompetence, ignorance, and arrogance all wrapped into one.

> You can't really fix that level of sheer incompetence, ignorance, and arrogance all wrapped into one. Sure you can. You can tell them why it's wrong and point them at reading material to fix it. Fixes incompetence and ignorance, and if you're lucky, arrogance. All wrapped into one. Everyone had to start somewhere.

True, but it depends how arrogant and stubborn they are. If they're just simply arrogant and don't understand, you can do something, but in many cases they'll insist "this is fine. what's your problem?"

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

#205
post #103

Earlier quoted context omitted.

Education software is literally the worst. Moodle was pretty ick to begin with, but you should've seen the state of one install I had to work on by the time I got to it. I still have nightmares.

Needs disrupting

Blackboard is a known aggressor with its patent portfolio and cash. They will acquire and extinguish or just kill you with a patent lawsuit if you present a significant threat to their products.

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

#206
post #124

Earlier quoted context omitted.

This^ and I'm only a student; I'll write a program in the evening and by the following morning I'm all, no, no, no!

I tend to spend a lot of time planning (almost as much as coding). I do tend to notice big changes over a period of 2-3 years but areas where I can notice improvements in say six months.

I think I spend too much time planning and not enough time just getting shit done. It's one of the things that I feel like I have to work on this year.

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

#207
post #199

Earlier quoted context omitted.

That might be the clearest way for you to write it today, though I'm talking about it being clear for someone else to read many years from now. As so many posts on HN have said lately; writing code is easy, it's the reading that's difficult.

How is if (x == true) easier to read than if (x)? Deliberate obtuseness makes things harder to read.

Read my original comment. It would very much depend on context, and, as I said, I'd be more inclined to do it in the false case.

It's funny, you still seem to think there is a "right and wrong" here, and you can't see that coding style is just like writing a poem - each individual will do things a little differently.

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

#208
post #207

Earlier quoted context omitted.

How is if (x == true) easier to read than if (x)? Deliberate obtuseness makes things harder to read.

Read my original comment. It would very much depend on context, and, as I said, I'd be more inclined to do it in the false case. It's funny, you still seem to think there is a "right and wrong" here, and you can't see that coding style is just like writing a poem - each individual will do things a little differently.

What context does it depend on? Where is it reasonable to say (x == true) instead of x?

Edit: your original post said "If I were writing something, and I really wanted to make it clear that I was testing a boolean to be true, I might write that." What does this even mean? Simply writing x isn't really really clear, so you write (x == true) to make it extra clear? if (x) is testing boolean to be true and it's crystal clear. What else can it mean?

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

#209
post #74

Am I the only one who thinks that the amount of flaming is kind of unproductive?

It's a common thing I see with programmers. I know I've been guilty of it before. I see some poorly coded module and I'm just disgusted of how bad it is and then proceed to say some of the nastiest things about the developer who wrote it, sometimes just aloud to myself, other times to my peers.

These days I do my best to try to remember we all make mistakes, and that instead of flaming whoever is responsible for a mistake when it rears its ugly head, it's probably best to take it as an opportunity to discuss what I saw as shortcomings in the code with them and turn it into a learning experience if possible. Sometimes of course this isn't possible when you inherit code from devs who are long gone. Either way, I'm not sure any good is done throwing all that negative energy into the air.

Post reply on HN