• (cs) in reply to Coyne
    Coyne:
    <rant> Storing phone number in a real. Sigh.

    Barcodes, category UPC. Social Security Number (SSN). Phone numbers. Zip code. Password, category "PIN". Street number.

    When will programmers learn the difference between numeric values that need to be processed mathematically and external identifiers they don't control, and stop storing the later in numeric columns?

    We just went through this yet again: A sister organization needs to use fake SSN's for people that don't want to provide a real one. They suggest values of the form A00-00-0000, and we have to decline. Because of the possibility that some idiot third-party designer for another sister system is storing SSN in an INTEGER.

    This anti-pattern may not be the biggest WTF ever, but it ranks high. </rant>

    That sounds more like a good reason to do it than a good reason not to, IMO. Gives the idiots a reason to fix their system. Everyone wins.

  • StanTheManIAm (unregistered)

    The WTF for the XBOX is that the list price wasn't $100 higher so the sales price didn't reflect the discount.

  • (cs) in reply to Decius
    Decius:
    da Doctah:
    Coyne:
    Barcodes, category UPC. Social Security Number (SSN). Phone numbers. Zip code. Password, category "PIN". Street number.

    When will programmers learn the difference between numeric values that need to be processed mathematically and external identifiers they don't control, and stop storing the later in numeric columns?

    Except for your last example.

    Because unlike the others, there is at least one way in which street numbers are treated arithmetically, albeit only in an ordinal sense and not necessarily as interval or ratio scales, and that's having a definitive lower and upper limit.

    If someone hands you an address on Whatchajiggy Street, and you happen to know that addresses on Whatchajiggy Street only run from 1900 through 8000 (where beyond the upper limit Whatchajiggy Street turns into Howzamacallit Parkway), you can do a range check and reject an obviously wrong address like 22246 (the guy meant to enter 2246 but his finger bounced on the key and he didn't realize it at the time). And you can even reject 8170 as invalid, which makes this different from the ones where someone just puts in too many digits.

    Do you think that maintaining a database of legitimate street numbers is less trivial than comparing a street address to them? How often do you need to check if a street number is real, if not just once on initial validation?

    Well, I sure wish UPS would do it!

    Back in the early 2000s, I ordered a bunch of books from Amazon. To this day I'm not sure what went wrong, but they got the street address completely wrong. Right street, but our house at the time was in the low 1000s, and the number on the address was in the mid-10000s. We lived in the middle of the town, but such a place, if it existed, would have been several miles out in the country. But UPS apparently tried and failed to deliver it.

    When I called them because my package didn't arrive on schedule, I was informed that they were "unable to find my house" because the address was wrong. "But don't worry, sir," the lady said. "We've already sent you a postcard explaining how you can take delivery of your package."

    How many WTFs can you count there?

  • (cs) in reply to Severity One
    Severity One:
    Steve The Cynic:
    And don't forget these things that screw up your convenient scheme for European street addresses:
    Don't forget Florence. In Florence, they reuse the numbers on certain streets, but they're the 'red' and the 'black' numbers. Red numbers are for shops and businesses, whereas black numbers are for private residences.

    Why? Well, why not? Probably, it seemed a good idea at the time.

    Maybe whoever set up the system was a big Les Mis fan.

  • Jay (unregistered) in reply to Gurth
    Gurth:
    da Doctah:
    Because unlike the others, there is at least one way in which street numbers are treated arithmetically, albeit only in an ordinal sense and not necessarily as interval or ratio scales, and that's having a definitive lower and upper limit.
    This may make sense in American-style addresses, but not in most European countries where numbers aren't assigned in blocks but simply start at 1 for every street and are incremented by 1 per building in the street, with no definite upper limit. Also, you might encounter a number like 7a because a new house was built between nos. 7 and 9, but renumbering the whole street would cause more confusion than it's worth.

    Many places I've visited now number buildings by a measurement of the distance from the beginning of the street rather than simply sequentially. For example, my address is 133. My neighbors are not 132 and 134 or 131 and 135, but rather 121 and 145. That way if a new building is put up between existing buildings, it's assigned a number in the middle.

    Likewise, US highway exit numbers used to be numbered 1, 2, 3, etc. Then if a new exit was created between, say, 2 and 3 it got numbered 2A. Now most of them have been renumbered by the number of miles from the beginning of the road. So if the next exit after exit 10 is 5 miles further on, it gets numbered exit 15.

  • Jay (unregistered) in reply to briverymouse
    briverymouse:
    - Allow you to do a lot of useless things, like multiplying telephone numbers.

    When I was a kid, we had one phone number for my entire family.

    Now, I have a cell phone number, my two kids each have their own cell phone number, plus I have a work phone in my house on a VOIP line, and I have a fax number. I used to have a separate land-line phone but I finally had that disconnected as 5 phone numbers for one house seemed sufficient.

    My phone numbers have definately been multiplying.

  • Jay (unregistered) in reply to da Doctah
    da Doctah:
    Coyne:
    Barcodes, category UPC. Social Security Number (SSN). Phone numbers. Zip code. Password, category "PIN". Street number.

    When will programmers learn the difference between numeric values that need to be processed mathematically and external identifiers they don't control, and stop storing the later in numeric columns?

    Except for your last example.

    Because unlike the others, there is at least one way in which street numbers are treated arithmetically, albeit only in an ordinal sense and not necessarily as interval or ratio scales, and that's having a definitive lower and upper limit.

    If someone hands you an address on Whatchajiggy Street, and you happen to know that addresses on Whatchajiggy Street only run from 1900 through 8000 (where beyond the upper limit Whatchajiggy Street turns into Howzamacallit Parkway), you can do a range check and reject an obviously wrong address like 22246 (the guy meant to enter 2246 but his finger bounced on the key and he didn't realize it at the time). And you can even reject 8170 as invalid, which makes this different from the ones where someone just puts in too many digits.

    Interesting point.

    Advantages of storing house number as an integer:

    1. Can sort by address. Handy for mail and package delivery. Way back when I did some door-to-door campaigning and they gave me a list of registered voters, sorted by street and house number. The board of elections called this a "walking list".

    2. Do range checks on addresses for validity.

    Disadvantages:

    1. A little extra work to put the address back together.

    2. Can't readily store unusual addresses, like "12B" or "127 1/2".

  • Vic (unregistered) in reply to ¯\(°_o)/¯ I DUNNO LOL
    ¯\(°_o)/¯ I DUNNO LOL:
    Steve The Cynic:
    Gurth:
    This may make sense in American-style addresses, but not in most European countries where numbers aren't assigned in blocks but simply start at 1 for every street and are incremented by 1 per building in the street, with no definite upper limit. Also, you might encounter a number like 7a because a new house was built between nos. 7 and 9, but renumbering the whole street would cause more confusion than it's worth.
    I vote we put this debate to bed. We should use a shotgun to make sure it doesn't rear its ugly head again.
    And then there are places where the street isn't even used. In Japan, addresses are based on the block you're located in, and are not even guaranteed to be sequential going around the block.

    It doesn't even make sense in the US. The "street number" can validly contain non-numeric characters. For example, fractional addresses (123 1/2 MAIN ST) are used in Los Angeles. Back in the mainframe days, this would sometimes be entered as a decimal, 123.5. But street numbers can also be alphanumeric, hyphenated, or worse. If you are interested, see appendices D and E of USPS publication 28.

    And as far as address validation is concerned, there are USPS approved software packages (with typically quarterly updates) which have the necessary databases.

  • (cs) in reply to Mason Wheeler
    Mason Wheeler:
    When I called [UPS] because my package didn't arrive on schedule, I was informed that they were "unable to find my house" because the address was wrong. "But don't worry, sir," the lady said. "We've already sent you a postcard explaining how you can take delivery of your package."

    How many WTFs can you count there?

    There's an entry about this on this site already, and someone in the thread explains the rationale behind UPS sending you a postcard. I can't find it on a quick search, but as I recall it's because the US postal service is very good at figuring out where to deliver mail when the address isn't correct — so UPS basically makes it someone else's problem in order to fix it.

  • OccupyWallStreet (unregistered) in reply to Jay
    Jay:
    Likewise, US highway exit numbers used to be numbered 1, 2, 3, etc. Then if a new exit was created between, say, 2 and 3 it got numbered 2A. Now most of them have been renumbered by the number of miles from the beginning of the road. So if the next exit after exit 10 is 5 miles further on, it gets numbered exit 15.

    You still get stuff like Exit 12A, 12B and 12C (I don't think there's a "D" suffix, but probably "D" and "E" somewhere). They happen when the exits are near the same mile marker. And sometimes it's labelled 12, 12A, 12B, and 12C.

    Of course, I wonder what happens should a new exit be created in-between say, 12 and 12A...

  • (cs) in reply to Severity One
    Severity One:
    briverymouse:
    The fact is, a telephone number consists of digits, but it is an address. It has none of the properties of mathematical numbers, and all the properties of addresses. There is no reason to counter-intuitively store it as an integer, unless you desperately need the disk size.
    On the other hand, you could consider it to be a unique identifier - and those are often numbers. (Except if you're working with Siebel, in which case it's a 64-byte string.)

    TRWTF is that we're still using MSISDNs (mobile phone numbers) on mobile phones, whereas each SIM card has its own unique identifier (IMSI). Which, um, is a 15-digit string.

    But yeah, being an opco, we work a lot with telephone numbers, and whoever decides to store them as a number has a thing or two to explain to me.

    A unique identifier until someone changes thier phone number without telling you and another person gets it and comes into your system. If you see them as unique, you are foobar'd.

  • (cs) in reply to Jay
    Jay:
    Advantages of storing house number as an integer:
    1. Can sort by address. Handy for mail and package delivery. Way back when I did some door-to-door campaigning and they gave me a list of registered voters, sorted by street and house number. The board of elections called this a "walking list".

    2. Do range checks on addresses for validity.

    Disadvantages:

    1. A little extra work to put the address back together.

    2. Can't readily store unusual addresses, like "12B" or "127 1/2".

    So you are saying you can not sequentially sort 12A, 12B, 13A, 13B? Seeing as how on the same street, these kinds of addresses usually do follow each other pretty well so your walking list still works out.

    Not to mention, no extra work putting them back together.

    Range checks on the apartment style address (99A) is usually a moot point and any range checks only hit extreme errors, a street that goes up to 10000 will not catch an error where someone ment 901 and hit 9001.

    So I don't see how your advantages are very advantagous.

  • vastrightwing (unregistered)

    Forget street number and road names. We should simply use latitude / longitude and a naming scheme like the DNS IP scheme we use for the internet.

    This way, we can express our address as simple name and/or a lat/lon address. If we suddenly get an earth quake and our lat/lon changes, all we have to do is update the address and the name stays the same. For example, I’m at 42.346845, -71.080878. Latitude and longitude numbers are real numbers and can actually be used in calculations! They can be treated as numerical data types or ASCII. Come on, this is much better.

    I’ll be in charge of the name database. Pay me only $6/year to associate your name to your latitude/longitude address. It’s a great deal!

  • J-L (unregistered)

    As long as we're on the subject of FooBar: I never feel bad for the Bar, but I always pity the Foo.

  • (cs) in reply to vastrightwing
    vastrightwing:
    Forget street number and road names. We should simply use latitude / longitude and a naming scheme like the DNS IP scheme we use for the internet.

    This way, we can express our address as simple name and/or a lat/lon address. If we suddenly get an earth quake and our lat/lon changes, all we have to do is update the address and the name stays the same. For example, I’m at 42.346845, -71.080878. Latitude and longitude numbers are real numbers and can actually be used in calculations! They can be treated as numerical data types or ASCII. Come on, this is much better.

    I’ll be in charge of the name database. Pay me only $6/year to associate your name to your latitude/longitude address. It’s a great deal!

    Sign me up! I could send updates every time I walk someplace. Better yet, let my smart phone auto update my lat/long address for me, and have the post office simply deliver to my name reference, mail will always get to me even if I'm waiting for the bus in the middle of no where.

    I love it! Ben Franklin be damed!

  • (cs)

    Obviously no one could think of any reason why you should hook your Rockband account up to Facebook, so they never got around to updating that text.

  • (cs) in reply to KattMan
    KattMan:
    I love it! Ben Franklin be damed!
    Well, he was damed, quite a bit, according to the tales told about him and his lecherousness...
  • Don (unregistered) in reply to Philip Newton
    Philip Newton:
    Similarly with postal codes - they look like numbers (in many countries) but don't have the properties of numbers, and should be stored as strings.

    Having leading zeroes dropped (if postal codes can start with 0, as they can at least in the US and Germany) is the least of the problems you get by treating them as numbers.

    They're strings! You can't calculate with them meaningfully, so store them as an opaque item.

    Postal codes are my personal pet peeve. Many countries, including the one I live in, do not have postal codes. Try registering on some sites that insist you should enter a postal code.

  • Don (unregistered) in reply to da Doctah
    da Doctah:
    Coyne:
    Barcodes, category UPC. Social Security Number (SSN). Phone numbers. Zip code. Password, category "PIN". Street number.

    When will programmers learn the difference between numeric values that need to be processed mathematically and external identifiers they don't control, and stop storing the later in numeric columns?

    Except for your last example.

    Because unlike the others, there is at least one way in which street numbers are treated arithmetically, albeit only in an ordinal sense and not necessarily as interval or ratio scales, and that's having a definitive lower and upper limit.

    If someone hands you an address on Whatchajiggy Street, and you happen to know that addresses on Whatchajiggy Street only run from 1900 through 8000 (where beyond the upper limit Whatchajiggy Street turns into Howzamacallit Parkway), you can do a range check and reject an obviously wrong address like 22246 (the guy meant to enter 2246 but his finger bounced on the key and he didn't realize it at the time). And you can even reject 8170 as invalid, which makes this different from the ones where someone just puts in too many digits.

    Yeah lets control the ranges for every street, every county, every country. It's not like there's any numbers. It's not like someone ever lived in an address like 221B Baker Street. Or like somebody without a number in their address, some imaginary place like Buckingham Palace or Villa Leopolda.

  • ack (unregistered)
  • (cs) in reply to Don
    Don:
    Philip Newton:
    Similarly with postal codes - they look like numbers (in many countries) but don't have the properties of numbers, and should be stored as strings.

    Having leading zeroes dropped (if postal codes can start with 0, as they can at least in the US and Germany) is the least of the problems you get by treating them as numbers.

    They're strings! You can't calculate with them meaningfully, so store them as an opaque item.

    Postal codes are my personal pet peeve. Many countries, including the one I live in, do not have postal codes. Try registering on some sites that insist you should enter a postal code.

    State/province is also annoying. It's like US companies do internationalisation by hiring a Canadian. Sure, most countries have some kind of subdivision larger than a city, but in how many small countries can you write that on a letter and not have the mail man look at you as if you're retarded?

  • DWalker (unregistered) in reply to Decius
    Decius:
    da Doctah:
    Coyne:
    Barcodes, category UPC. Social Security Number (SSN). Phone numbers. Zip code. Password, category "PIN". Street number.

    When will programmers learn the difference between numeric values that need to be processed mathematically and external identifiers they don't control, and stop storing the later in numeric columns?

    Except for your last example.

    Because unlike the others, there is at least one way in which street numbers are treated arithmetically, albeit only in an ordinal sense and not necessarily as interval or ratio scales, and that's having a definitive lower and upper limit.

    If someone hands you an address on Whatchajiggy Street, and you happen to know that addresses on Whatchajiggy Street only run from 1900 through 8000 (where beyond the upper limit Whatchajiggy Street turns into Howzamacallit Parkway), you can do a range check and reject an obviously wrong address like 22246 (the guy meant to enter 2246 but his finger bounced on the key and he didn't realize it at the time). And you can even reject 8170 as invalid, which makes this different from the ones where someone just puts in too many digits.

    Do you think that maintaining a database of legitimate street numbers is less trivial than comparing a street address to them? How often do you need to check if a street number is real, if not just once on initial validation?

    You should never maintain a database of legitimate street numbers yourself. It's much better to invoke the USPS Web service (API, interface, whatever it's called) to validate an address.

  • DWalker (unregistered) in reply to KattMan
    KattMan:
    Jay:
    Advantages of storing house number as an integer:
    1. Can sort by address. Handy for mail and package delivery. Way back when I did some door-to-door campaigning and they gave me a list of registered voters, sorted by street and house number. The board of elections called this a "walking list".

    2. Do range checks on addresses for validity.

    Disadvantages:

    1. A little extra work to put the address back together.

    2. Can't readily store unusual addresses, like "12B" or "127 1/2".

    So you are saying you can not sequentially sort 12A, 12B, 13A, 13B? Seeing as how on the same street, these kinds of addresses usually do follow each other pretty well so your walking list still works out.

    Not to mention, no extra work putting them back together.

    Range checks on the apartment style address (99A) is usually a moot point and any range checks only hit extreme errors, a street that goes up to 10000 will not catch an error where someone ment 901 and hit 9001.

    So I don't see how your advantages are very advantagous.

    Are you serious? In most parts of the US, streets have odd-numbered addresses on one side and even-numbered addresses on the other side.

    If you sort addresses to get a "walking list", and deliver mail or anything else in that order, you'll end up walking across the street between every delivery.

    It's much better walk down one side of the street, cross once, and walk back up the other side. So, half the numbers within one block need to be ordered in reverse.

    A better solution is to use a "Carrier route" sort. The USPS has a lot more experience in this area than any computer programmer who hasn't studied street addresses in detail.

  • El Ka-Ben (unregistered)

    I've always considered Yes/No/Cancel to be the sign of lazy programmers and a good indication of buggy code.

    Dialogs should have buttons with a clearly defined purpose. For the Communicator example I'd suggest "Remove" and "Keep" as the buttons. I've contemplated many times weather "Yes" or "No" was the path I wanted to take in a poorly worded dialog box.

  • aD (unregistered) in reply to Vamp

    It looked like you went to comment sensibly. Are you sure you wish to do this?

    (No, it's fine) (Yes, you're right)

    Damn you, Thunderbird, and your stupid attachment warnings.

  • C (unregistered) in reply to Gurth
    Gurth:
    Vamp:
    Am I the only one that thinks the YES/NO/CANCEL style dialogs are good practice?
    Better practice would be labelling the buttons with what they actually do: "Remove this contact from your contact list? [Remove] [Don't remove] [Cancel]" — but like many others I still don't see what the Cancel button would do here that differs from the function of the No (or Don't Remove) button.
    There is that tiny fraction of cases where the deletion is part of a larger operation - say, i removed the only contract for that person. So the dialog would go: [Title: Removing contract] "[Also] Remove the contact? [Yes, remove both] [No, keep person] [Cancel, keep both]"...
  • (cs) in reply to briverymouse
    briverymouse:
    Don:
    Philip Newton:
    Similarly with postal codes - they look like numbers (in many countries) but don't have the properties of numbers, and should be stored as strings.

    Having leading zeroes dropped (if postal codes can start with 0, as they can at least in the US and Germany) is the least of the problems you get by treating them as numbers.

    They're strings! You can't calculate with them meaningfully, so store them as an opaque item.

    Postal codes are my personal pet peeve. Many countries, including the one I live in, do not have postal codes. Try registering on some sites that insist you should enter a postal code.

    State/province is also annoying. It's like US companies do internationalisation by hiring a Canadian. Sure, most countries have some kind of subdivision larger than a city, but in how many small countries can you write that on a letter and not have the mail man look at you as if you're retarded?

    It should be most of them: the postal workers should know that problem better than the general populace. I would guess that problem would only be in those with exceptionally stupid mail carriers, or an exceptionally timid population (such that they're too embarrassed to claim that they live in Paris, France, France, for example. Oh wait - that's not a small country; it just doesn't apparently have any federated states). Of course, every postal carrier is new to the job for at least the first bit, so you could get that look anywhere. But I'd think it'd be rare. Instead, they'd look at you with sympathy. "Oh, you have to deal with those people."

Leave a comment on “Variable Cash Back”

Log In or post as a guest

Replying to comment #:

« Return to Article