When foo and bar is not enough [closed]

2019-03-08 00:19发布

When you are using placeholder names when programming (not necessary variable names, but labels, mockup names, etc) and foo and bar is not enough, what do you use?

I guess baz is rather common as third name, and the lorem ipsum for longer texts. But then what?

26条回答
劳资没心,怎么记你
2楼-- · 2019-03-08 00:42

From Wikipedia:

A "standard list of metasyntactic variables used in syntax examples" is: foo, bar, baz, qux, quux, corge, uier, grault, garply, waldo, fred, plugh, thud, mos, henk, def.

查看更多
Viruses.
3楼-- · 2019-03-08 00:42

I've also seen fee, fie, foe, fum.

查看更多
不美不萌又怎样
4楼-- · 2019-03-08 00:42

I often go to blah after foo and bar. I usually stop there.

查看更多
甜甜的少女心
5楼-- · 2019-03-08 00:44

It's probably a better habit to use names related to the problem, since this will aid communication.

But in cases where you are working in the abstract and really don't want the names to matter, there are lists of commonly-used metasyntactic variables available in the Jargon File (which lists several different progressions) or from Wikipedia (currently "foo, bar, baz, qux, quux, corge, uier, grault, garply, waldo, fred, plugh, thud, mos, henk, def").

Personally, I've never seen or used most of the unpronounceable words in those lists, but I have seen and prefer to use "foo, bar, baz, spam, fred, xyzzy."

Ultimately, any set of nonsense words should work, or any set of words that are nonsensical relative to the problem.

Some folks I know get really sick of foo, bar, et al., so an alternative is to use character names from TV shows. I frequently use "Fred, Barney, Wilma, Betty, Pebbles, BammBamm." This is particularly useful in abstract OO discussions, because "Fred is-a Flintstone" comes across pretty clearly.

查看更多
姐就是有狂的资本
6楼-- · 2019-03-08 00:44

I use the Greek alphabet, but I rarely go past delta.

查看更多
劳资没心,怎么记你
7楼-- · 2019-03-08 00:46

In Italy, Disney characters are faves: Pippo, Paperino, Topolino, (resp. Goofy, Donald, Mickey). Italy is, or was, the second country in Disney Popularity after the USA.

查看更多
登录 后发表回答