In languages like Java, Javascript, C, C++, C#, I have seen code similar to the folowing in tutorials and code snippets.
int foo = 5;
int bar = 10;
baz(foo, bar);
I assume these are used for quick variable names when naming conventions do not really need to be followed, such as quick snippets, but they have become so popular, they seem to be part of the language. For example, python has traded foo
and bar
for spam
and eggs
.
spam = 'spam'
eggs = 'eggs'
spam_and_eggs(spam, eggs)
When I see these variable names, I instantly think of python and no other language. Do other languages have signature placeholder variable names such as python?
These variables aren't generally part of the languages at all, they're called meta-syntactic variables and allow you to use variables in example code without having to think too hard about what it should be called.
I tend to use something similar, calling all my source files qq.c
or qq.py
(for example) when testing one-shot code for Stack Overflow.
The Jargon file lists a decent variety of these (including their likely etymology) but, unfortunately, fail to list my personal favorites, xyzzy
, plugh
, twisty
and passages
, in order of preference and use, and showing my age :-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With