What does 'foo' really mean?

前端 未结 9 1423
无人及你
无人及你 2020-11-30 16:39

I hope this qualifies as a programming question, as in any programming tutorial, you eventually come across \'foo\' in the code examples. (yeah, right?)

what does \'

相关标签:
9条回答
  • 2020-11-30 17:05

    foo = File or Object. It is used in place of an object variable or file name.

    0 讨论(0)
  • 2020-11-30 17:06

    It's a metasyntactic variable.

    0 讨论(0)
  • 2020-11-30 17:14

    Among my colleagues, the meaning (or perhaps more accurately - the use) of the term "foo" has been to serve as a placeholder to represent an example for a name. Examples include, but not limited to, yourVariableName, yourObjectName, or yourColumnName.

    Today, I avoid using "foo" and prefer using this type of named substitution for a couple of reasons.

    • In my earlier days, I originally found the use of "foo" as a placement in any example to represent something as f'd-up to be confusing. I wanted a working example, not something that was foobar.
    • Your results may vary, but I always, 100%, everytime, never-failed, got more follow-up questions about the meaning of the actual variable where "foo" was used.
    0 讨论(0)
提交回复
热议问题