Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

Skuto posted:

This is also a stupid idea if there's a remote possibility the database isn't 100% up to date.
Or just plain wrong. Bank of America insists my (several decades old) apartment building with an utterly mundane address doesn't exist and refused to accept it as a mailing address.

Adbot
ADBOT LOVES YOU

ToxicFrog
Apr 26, 2008


Subjunctive posted:

Validation doesn't have to reject. It can be quite useful to simply warn that you selected US for your country but only have 9 digits in your phone number. I see sites periodically that warn if I mistype my email address as @gmali.com, and it's nice.

Man. It would be nice if any site that I've ever used did that rather than just rejecting my email address out of hand.

kitten smoothie
Dec 29, 2001

Subjunctive posted:

Validation doesn't have to reject. It can be quite useful to simply warn that you selected US for your country but only have 9 digits in your phone number. I see sites periodically that warn if I mistype my email address as @gmali.com, and it's nice.

See also https://github.com/mailcheck/mailcheck

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Skuto posted:

That's a decent solution. I'd guess continuously getting warnings "your name is not valid" is annoying,

Oh, I wouldn't do it for names. The warning can be a little (/_\) warning triangle and hint next to the entry, rather than another step.

At one point we noticed that we were seeing a lot of accounts with obviously fake last names like Supermarket or Facebook (esp in a non-English locale). Turns out that in the region in question (Malaysia? Indonesia?) a lot of people don't have last names, and we required them, so they had to make something up.

Steve French
Sep 8, 2003

Holy poo poo I would be livid if every service I gave my phone number to called me to make sure it was a valid phone number what is wrong with you people

Hiowf
Jun 28, 2013

We don't do .DOC in my cave.

Steve French posted:

Holy poo poo I would be livid if every service I gave my phone number to called me to make sure it was a valid phone number what is wrong with you people

Many services send an SMS.

(Preferably, unless it's absolutely unavoidably non-negotiably critical the phone number is correct, you shouldn't care and just don't try to verify because who cares anyway)

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
If having a correct phone number is actually important I don't mind a verification SMS, and if it isn't you aren't getting my real phone number anyway.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Mandatory entries where it doesn't make sense to the used why they're mandatory is a great way to get a ton of garbage in your database.

Steve French
Sep 8, 2003

Skuto posted:

Many services send an SMS.

(Preferably, unless it's absolutely unavoidably non-negotiably critical the phone number is correct, you shouldn't care and just don't try to verify because who cares anyway)

Surely you didn't think I was unaware of that. Not all phone numbers can receive SMS messages.

More important is the previously made point that in some situations one might be entering a phone number or email address that *isn't yours*.

I'm not saying sending an SMS or email is never the right answer, just that it isn't always the right answer. Use your imagination; there are plenty of situations where you might want to make a best-effort check of the validity of a phone number or email address and not actually send anything. There is also no rule that says that if the validation check fails that form submission is blocked; you may simply wish to be helpful to the user and point out a possible fatfingering.

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Steve French posted:

There is also no rule that says that if the validation check fails that form submission is blocked; you may simply wish to be helpful to the user and point out a possible fatfingering.

Tell that to everyone else doing input validation

Steve French
Sep 8, 2003

I'd rather tell you that you're missing the point.

Polio Vax Scene
Apr 5, 2009



I like the idea of "hey we weren't able to validate your thing, please double check to make sure it's correct and we'll let it pass" the best.

Steve French
Sep 8, 2003

I don't see why you need to have any code that tries to determine if a postal address is valid; just mail them something.

Hiowf
Jun 28, 2013

We don't do .DOC in my cave.

Steve French posted:

I don't see why you need to have any code that tries to determine if a postal address is valid; just mail them something.

Ever tried verifying PayPal?

BTW, given that the entire point of the discussion was that trying to verify things (with code) is stupid, I hope you're not seriously advocating trying to validate postal addresses by code - rather than just accepting the input and STFU - because by now I do hope you're the only one who thinks that's a sane idea.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slĉgt skal fĝlge slĉgters gang



Skuto posted:

Ever tried verifying PayPal?

BTW, given that the entire point of the discussion was that trying to verify things (with code) is stupid, I hope you're not seriously advocating trying to validate postal addresses by code - rather than just accepting the input and STFU - because by now I do hope you're the only one who thinks that's a sane idea.

man thats the second sarcastic post in this thread you've failed to get

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Holy crap how are you guys still really mad about phone numbers?

Hiowf
Jun 28, 2013

We don't do .DOC in my cave.

Suspicious Dish posted:

Holy crap how are you guys still really mad about phone numbers?

<RED EXCLAMATION MARK>

That's not a valid name/phone/number/address/argument/post, please resubmit.

McGlockenshire
Dec 16, 2005

GOLLOCKS!

Skuto posted:

I hope you're not seriously advocating trying to validate postal addresses by code - rather than just accepting the input and STFU

I hope you never have to write sales tax code for a jurisdiction that requires the tax be levied based on where the buyer lives. Not just postal code, not just city, not just street, but the complete address can end up mattering, and it all has to be correct the first time.

The real horror is that you can move one house down on the same street in the same city and change sales tax districts. gently caress Washington state.

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

Um excuse me I'm the smartest programmer so I need the last word thanks.

Mogomra
Nov 5, 2005

simply having a wonderful time
But guys. Like. What is "valid?"

:2bong:

Alereon
Feb 6, 2004

Dehumanize yourself and face to Trumpshed
College Slice

Skuto posted:

Scales well for international websites. And tell me, does it work for extensions too in the USA?
Just a note, this actually does scale internationally because they had this figured out about 5 years ago. You can even get real-time number portability data for most countries you wouldn't expect, for qualifying uses. And that's why phone number fields have an "extension" field after them :)I was only half serious at most if this is not clear

Validation is hard and easy to argue about, but once you get over good/bad or smart/stupid you come to a real philosophical difference about where to place the mental effort on turning input data into something useful: do you do that at data entry time, or when reading the data? Generally when we're talking about validation that means we care about the former case, so it's much more important to reject malformed input and force users to figure out how to correctly form their input to meet requirements (or call support) than it is to let them type their phone number in their preferred form. Sometimes the latter case is true, like if your call center agents are filling out tickets you probably don't want any input validation on the phone number field, except maybe non-empty.

Polio Vax Scene
Apr 5, 2009



Mogomra posted:

But guys. Like. What is "valid?"

:2bong:

Not your posts :smug:

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

McGlockenshire posted:

I hope you never have to write sales tax code for a jurisdiction that requires the tax be levied based on where the buyer lives. Not just postal code, not just city, not just street, but the complete address can end up mattering, and it all has to be correct the first time.

The real horror is that you can move one house down on the same street in the same city and change sales tax districts. gently caress Washington state.

Just gotta establish a subsidiary entirely outside of Washington which handles sales to Washington customers and then tell them they're responsible for paying use tax themselves.

Hiowf
Jun 28, 2013

We don't do .DOC in my cave.

quote:

I hope you never have to write sales tax code

That makes two of us.

quote:

gently caress Washington state.

Realistically once you get to the point where you need different tax rules per state, you're either limited to a specific geographical areas where your odds of getting it correct are higher (but you'll probably still get it wrong occasionally). If you code something that works well internationally, that's a business in itself.

Alereon posted:

Just a note, this actually does scale internationally because they had this figured out about 5 years ago. You can even get real-time number portability data for most countries you wouldn't expect, for qualifying uses.

Sounds useful. I don't think I've encountered this. Most stuff you meet seems to fall either under the "the number is important, and we'll send an SMS to verify" or "lol no way you're getting my real phone number please pretend this random sequence of US-style phone number digits is real".

SMS seems less common in the USA, but then again you seem to have a more uniform or at least standardized numbering system.

quote:

where to place the mental effort on turning input data into something useful: do you do that at data entry time, or when reading the data?

Depends on the usage. If you're collecting stats (or calculating taxes) for example, you can look at what you need to know and what data will be valid where you're interested.

If you need to ship something somewhere, and you require a county field or a zip code, you're bad. If you have no actual need for an address and still ask for those things, expletives are warranted.

If you're validating input because you don't know what a stored procedure is but you've heard of Bobby Tables, you're a lost cause. (Hi Adobe!)

HFX
Nov 29, 2004

McGlockenshire posted:

I hope you never have to write sales tax code for a jurisdiction that requires the tax be levied based on where the buyer lives. Not just postal code, not just city, not just street, but the complete address can end up mattering, and it all has to be correct the first time.

The real horror is that you can move one house down on the same street in the same city and change sales tax districts. gently caress Washington state.

This works for the insurance industry too.

QuarkJets
Sep 8, 2008

At the place where I work, one of the guys who designs GUIs uses red boxes where everyone else would be using green. As in, red status boxes displaying the word "OKAY" when a system is okay. He's not color blind, just likes the color red. If a system is in an error state, the box is red for that, too. If a system is in a warning state or something then it's yellow

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

QuarkJets posted:

At the place where I work, one of the guys who designs GUIs uses red boxes where everyone else would be using green. As in, red status boxes displaying the word "OKAY" when a system is okay. He's not color blind, just likes the color red. If a system is in an error state, the box is red for that, too. If a system is in a warning state or something then it's yellow

If he were colorblind, he'd know not to use color as the sole indicator of status. I'm colorblind and it drives me insane. I can't see every shade of red or green, and a lot of dark reds look black unless I'm looking really closely.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Suspicious Dish posted:

Holy crap how are you guys still really mad about phone numbers?

Don't get me started about Telex.

baka kaba
Jul 19, 2003

PLEASE ASK ME, THE SELF-PROFESSED NO #1 PAUL CATTERMOLE FAN IN THE SOMETHING AWFUL S-CLUB 7 MEGATHREAD, TO NAME A SINGLE SONG BY HIS EXCELLENT NU-METAL SIDE PROJECT, SKUA, AND IF I CAN'T PLEASE TELL ME TO
EAT SHIT

Subjunctive posted:

Don't get me started about Telex.

You can test it but it will not fail?

EAT THE EGGS RICOLA
May 29, 2008

lol if you don't automatically validate every phone number that gets put into your system by calling them with twilio and making them solve a quiz over the phone (in case they're a robot phone)

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slĉgt skal fĝlge slĉgters gang



Subjunctive posted:

Don't get me started about Telex.

no keep going. assuming by telex you mean:

https://www.youtube.com/watch?v=BqsHNEuaSCI

e: whoa that video is way more :nws: than i expected

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Subjunctive posted:

Don't get me started about Telex.

OK, I won't. Thanks for the heads up!

Paul MaudDib
May 3, 2006

TEAM NVIDIA:
FORUM POLICE

Soricidus posted:

Email address validation with a regex doesn't get you anything. It's very likely you'll reject valid addresses, and likewise it's very likely users will input "valid" addresses that have typos in them. The way to validate an email address is to accept whatever the gently caress the user types and then send it an email with a validation link in it.

Yeah, I've had valid email addresses rejected in some rather highbrow sites. I had a university email address that was formatted first.m.last@university.edu and Amazon wouldn't let me register that for Amazon Student. Not exactly a weird scheme for an educational email address. It wasn't the first time that happened, either, at one point I got fed up and asked the university to change to first.last but no dice, ADDRESSES ARE WHAT THEY ARE :bahgawd:

Gmail +tag filtering sounded really cool until I realized that the number of sites that accept those email addresses as valid can be counted on one hand.

I really wish more programmers would just take that advice. Filter any escape characters, send a validation email, if the link gets clicked it's valid, end of story.

Paul MaudDib fucked around with this message at 20:47 on Jul 19, 2014

Hughlander
May 11, 2005

Paul MaudDib posted:

Gmail +tag filtering sounded really cool until I realized that the number of sites that accept those email addresses as valid can be counted on one hand.

I have a custom domain with wildcard forwarding to my gmail account and I've found a few sites that won't allow their name in an email address. Ie: foobar.com rejects foobar@hughlander.com

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Paul MaudDib posted:

Yeah, I've had valid email addresses rejected in some rather highbrow sites. I had a university email address that was formatted first.m.last@university.edu and Amazon wouldn't let me register that for Amazon Student. Not exactly a weird scheme for an educational email address. It wasn't the first time that happened, either, at one point I got fed up and asked the university to change to first.last but no dice, ADDRESSES ARE WHAT THEY ARE :bahgawd:

Gmail +tag filtering sounded really cool until I realized that the number of sites that accept those email addresses as valid can be counted on one hand.

I really wish more programmers would just take that advice. Filter any escape characters, send a validation email, if the link gets clicked it's valid, end of story.

Did you ever contact Amazon? It seems like a needlessly specific requirement.

necrotic
Aug 2, 2005
I owe my brother big time for this!

Hughlander posted:

I have a custom domain with wildcard forwarding to my gmail account and I've found a few sites that won't allow their name in an email address. Ie: foobar.com rejects foobar@hughlander.com

Catch-alls are the best thing ever given how many websites hate + aliases. I have been lucky enough not to encounter this issue (yet).

ShadowHawk
Jun 25, 2000

CERTIFIED PRE OWNED TESLA OWNER

Hughlander posted:

I have a custom domain with wildcard forwarding to my gmail account and I've found a few sites that won't allow their name in an email address. Ie: foobar.com rejects foobar@hughlander.com

This is probably a regex attempting to prevent people from getting their own registration system to email bomb themselves.

Paul MaudDib
May 3, 2006

TEAM NVIDIA:
FORUM POLICE

Volmarias posted:

Did you ever contact Amazon? It seems like a needlessly specific requirement.

Yeah, they fixed it within a week or two (circa 2010)

TheresaJayne
Jul 1, 2011
Address validation is even worse,

I had to enter a town name into an online form

I tried to enter the Town Name : Münster

Invalid Address : Can only contain Alpha Characters

I cant Put Munster as that is a different town in a different Country....

FAIL......

Adbot
ADBOT LOVES YOU

FoiledAgain
May 6, 2007

TheresaJayne posted:

Address validation is even worse,

I had to enter a town name into an online form

I tried to enter the Town Name : Münster

Invalid Address : Can only contain Alpha Characters

I cant Put Munster as that is a different town in a different Country....

FAIL......

My brother was born in a city which has since changed its name, in a territory which has since changed its name. He sometimes runs into the problem of a system asking for his birthplace, then rejecting it as an actual location.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply