Search code examples
language-agnosticplaceholder

Are there any placeholder numbers in a programming context?


The terms foobar, foo, bar, baz and qux are sometimes used as placeholder names (also referred to as metasyntactic variables) in computer programming or computer-related documentation.

...As stated here.

Are there any placeholders for numbers?

Update:

To be more clear, here are some examples where it would be useful to have placeholder numbers:

  • Credit card numbers
  • Licence plates
  • Phone numbers
  • Bar codes (the actual numbers)
  • Freestyle (any length and any numbers)

Solution

  • This Wikipedia article lists many magic numbers, in particular the famous DEADBEEF. However, it's often a bad practice to use magic numbers since they don't have a common meaning, so they aren't used as often as 'foo' or 'bar' (except, maybe, hex addressed like DEADBEEF). I tend to use all zeros or 1234567890 for things like credit card numbers / phone numbers in my tests. Occasionally I use 42 just for fun but only even then I make sure it's clear that it's a joke.