• Dennis (unregistered)

    Storing customer IDs as number types is not just "not ideal", it is WRONG, TRWTF, and the source of all these issues.

    I'd like to hate on Microsoft, but this is not their fault.

  • Dennis (unregistered) in reply to Dennis

    Oh, and "I like to prefix" is also just wrong. Either you always pad to a specific width, or you never prefix.

  • Dennis (unregistered) in reply to Dennis

    Sorry, I was a bit unspecific: Storing as floating point numbers (no matter the precision) is wrong. Proper integers are fine.

  • Officer Johnny Holzkopf (unregistered)

    Consideration: If we can't do arithmetics with them, they are not numbers, no matter how we call them. Let's say we have customer 123 and customer 456, can we do something like "customer 123 + customer 456" to get customer 579? What if we substract 100 from customer 12345? Do we have 3 times customer 23456? What is 1/12th of customer 9876? Would that make any sense? No? Then: Those are strings (or maybe even a specific native or constructed datatype), but not numbers, no matter if we "implicitely" consider them integers, floats our doubles just because they could look like those. It can even start with plain words, thought about carefully, maybe: "customer ID" (an ID doesn't imply it's a number) instead of "customer number", and on the other hand, customer IDs like "003.0278854", "CT8879556", "187/9965/0002774" wouldn't be called "numbers" either. Sadly, we routinely say things like "phone number" and then use integers... Language enables thinking. And that should have been possible decades ago.

  • Daniel Orner (github)

    The only main reason you'd use numbers instead of strings is for storage size... if customer IDs are guaranteed to always be integers (e.g. they're auto-increment IDs), they use way less storage than a string, and things like indexes are much more performant. Obviously depends on the scale of data you're working with, how big the strings/numbers are, and how important performance is.

Leave a comment on “Floating Along”

Log In or post as a guest

Replying to comment #703488:

« Return to Article