`
louisling
  • 浏览: 143101 次
  • 性别: Icon_minigender_1
  • 来自: ZhuHai
社区版块
存档分类
最新评论

FOO 究竟是什么意思?

阅读更多
经常在书上的例子里面看见 foo 这个方法名称,一直不知道这个单词是什么意思,不过猜测,应该相当于A,B,C,D..甲、乙、丙、丁...之类的意思,今天特意去查询一下:

[url]http://searchcio-midmarket.techtarget.com/sDefinition/0,,sid183_gci212139,00.html[url]

foo

引用
Just as economists sometimes use the term "widget" as the ultimate substitute for "something" that is being measured, programmers tend to use the term "foo" (pronounced FOO) as a universal substitute for something real when discussing ideas or presenting examples. Suppose you are defining a template for any group of programmers to follow when creating a new user command, you might specify that the syntax for the command should be in the form:
  Command foo (arg1, arg2)

where the "foo" would mean "the name you give to this command." In other words, "foo" is a nonsense kind of placeholder for some value that will be provided when using this template to define a real command. (And the "arg1" and "arg2" are arguments or information you would define that would be passed along with the command.) Because "foo" has no rational meaning of its own and because "foo" is conventionally used as such a placeholder, the idea will be clear to any programmer.
Foo or any such word used this way is formally known as a metasyntactic variable. Eric Raymond, probably the world's greatest authority on foo and other metasyntactic variables, also lists qux, waldo, fred, xyzzy, and thud among others that are occasionally used. Although foo is the canonical metasyntactic variable, Raymond notes that cultures outside the United States have their own preferences. Fred, barney, and wombat seem common in the U.K. Toto, tata, titi, and tutu reportedly are used by the French. Blarg and wibble are used in New Zealand.

The origin of foo seems wrapped in the mists of time, but Raymond observes (and we remember) that in Bill Holman's comic strip of the 1930-50 era, Smokey Stover, the letters "FOO" commonly appeared, unexplained and as a kind of running gag, on license plates, in picture frames, and on the backs of sandwich board signs.

Also see FUBAR.


CONTRIBUTORS: Kevin Barrett and R. Terry McCutchen
LAST UPDATED: 14 Dec 2006
分享到:
评论

相关推荐

    编程中常见的Foo,是什么意思?.md

    编程中常见的Foo,是什么意思?.md

    嵌入式Linux C语言面试试题1.pdf

    17. a+++++b所表示的是什么意思?有什么问题? 知识点:a+++++b所表示的是a = a + 1; a = a + b;,但是这种写法可能会导致未定义行为。 18. 如何定义Bool变量的TRUE和FALSE的值? 知识点:可以使用#define TRUE 1...

    程序员需要经常刷题吗-awesome-js::unicorn:精选的JavaScript基础和算法列表

    “优先于类继承的对象组合”是什么意思? 1.0.7 什么是双向数据绑定和单向数据流,它们有何不同? 1.0.8 单体架构与微服务架构的优缺点是什么? 1.0.9 什么是异步编程,为什么它在 JavaScript 中很重要? 1.0.10 ...

    Javascript优化技巧之短路表达式详细介绍

    这行代码是什么意思?答案: 代码如下: //如果foo存在,值不变,否则把bar的值赋给foo if(!foo)  foo = bar; 在javascript的逻辑运算中,0、””、null、false、undefined、NaN都会判定为false,而其他都为true。...

    Java泛型中? super T和? extends T的区别

    extends T>的声明,是什么意思呢?<? super T>表示包括T在内的任何T的父类,<? extends T>表示包括T在内的任何T的子类,下面我们详细分析一下两种通配符具体的区别。  extends  List<? extends Number...

    FOOBAR2000之wasapi

    通过安装和配置压缩包中的文件,特别是foo_out_wasapi.dll插件,你可以让foobar2000以独占模式通过WASAPI与音频设备通信,从而达到降低系统噪声、减少延迟、提升音质的目的。这尤其适合那些对音频质量有高要求的用户...

    C#语法中的Param应用

    在这里,如果`GetArrayOrNull()`返回`null`,`Foo`方法内部尝试访问`parameters.Length`时,就会抛出`NullReferenceException`。因为在C#中,传递`null`给`params`参数会将其视为一个空数组(`{}`),而不是一个包含...

    makefile.pdf

    ### Makefile概述与核心元素详解 #### 一、Makefile的核心组成部分 Makefile是一种用于自动化构建过程的脚本文件,广泛应用于软件开发领域。通过定义一组规则和目标,Makefile能够自动化执行各种编译和链接任务。...

    PHP新浪面试题,面试必看。

    `error_reporting(2047)` 是什么意思? `error_reporting(2047)` 设置了错误报告级别为 E_ALL 和 E_STRICT 的组合,这意味着所有的错误和警告都将被报告,包括 PHP 代码风格的建议。数字 2047 对应于 E_ALL | E_...

    python-ruby:我应该学习Python还是Ruby?

    动态是什么意思? 好吧,使用动态类型的语言,您可以执行以下操作: >>> variable = 1 >>> type(variable) >>> variable = " Foo " >>> type(variable) >>> variable = [ " bar " ,10] >>> type(variable) ...

    meant:就像git中npm的“你的意思吗?”一样

    意思是 就像Did you mean? 在git中为npm 原料药 含义(项目,列表) item {String}查找近似值的键 list {Array}用于与项目进行比较的列表 const meant = require ( 'meant' ) const result = meant ( 'foa' , [ '...

    dts-generator:生成单个.d.ts包,其中包含从TypeScript模块文件导出的外部模块声明

    这是什么意思? 如果您有一个包含大量单独的TypeScript文件的项目,这些文件被设计为作为外部模块使用,则TypeScript编译器不允许您从中实际创建一个捆绑包。 该软件包利用TypeScript 1.4+中的TypeScript语言服务来...

    net学习笔记及其他代码应用

    20.什么是Code-Behind技术? 答:代码后植。 21.在.net中,配件的意思是? 答:程序集。(中间语言,源数据,资源,装配清单) 22.常用的调用WebService的方法有哪些? 答:1.使用WSDL.exe命令行工具。 2.使用...

    DSP中CSL头文件中宏中#和##的用法介绍

    若调用`MACRO_NAME(_foo)`,则`CONCATENATE(name, _foo)`会变为`name##_foo`,最终宏展开后的结果是`name_foo`。这个特性在创建基于模板的宏或动态生成标识符时非常实用。 在DSP的CSL库中,`#`和`##`运算符可能被...

Global site tag (gtag.js) - Google Analytics