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.
How not to check the validity of an email address
201–210 of 243 posts
Re: How not to check the validity of an email address
#202Earlier 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.
Re: How not to check the validity of an email address
#203Earlier 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.
Re: How not to check the validity of an email address
#204Earlier 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.
Re: How not to check the validity of an email address
#205Earlier 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
Re: How not to check the validity of an email address
#206Earlier 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.
Re: How not to check the validity of an email address
#207Earlier 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.
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
#208Earlier 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.
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
#209Am I the only one who thinks that the amount of flaming is kind of unproductive?
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.