为什么程序猿喜欢用Foo()

2,440 阅读2分钟


It isn't easy being a programmer. They code all day, debug all night and go through thousands of code lines trying to clear up all possible messes before going live with their code. Sometimes, it takes a fellow programmer to understand the hardships of another programmer. The same can be said of their jokes. In this post, we have collected a handful of jokes, that have been floating around the Web, which showcase a programmer's sense of humor. Don't worry…

     经常能在各种包或者框架的示例代码里看到foo()

     有关foo的起源,维基百科上是这么说的(枯燥预警)

      术语foobar,foo,bar和baz是计算机编程或计算机相关文档中常用的占位符名称(也称为元语法变量)。它们通常用于表示未知值,通常在描述了解未知值目的但其精确值是任意且不重要的场景时使用。这些术语可用于表示复杂系统或概念的任何部分,包括数据,变量,函数和命令。单词本身在这种用法中没有意义,仅是逻辑表示,非常类似于代数中使用的字母x和y。Foobar通常单独使用。当需要多个实体时,通常按此顺序使用foo,bar和baz。 Foo作为一种新词而进入英语,并且被许多人认为是元语法变量的典范示例。[Citation needed]它广泛用于计算机编程示例(有时表示为“仅一次”)和伪代码。埃里克·雷蒙德(Eric S. Raymond)称其为“重要的黑客行为”,与k夫和cru夫并列。[1] http://en.wikipedia.org/wiki/Foo

     

    当然也有比较Brogrammer的说法 

    f**ked up beyond any repair

    



        聊完起源,我们进入正题,这个掘金号的名字Fco0, 灵感就来自foo(),不知道大家有没有听过一首歌叫《无名之辈》,foo()就是这样一个无名之辈,我们想表达的也都在里面了,后期会输出一些平时coding中积累的有实战价值的包,或者代码片段。当然也会有面经, 欢迎关注和加入我们!

无名之辈传送门 music.163.com/#/song?id=1…