开发者

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 numb开发者_StackOverflow社区ers)


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.


I don't know if there are any standard ones, but..

You could do 1337..

Or 42 (the meaning of life)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜