http://byfat.xxx/if-hemingway-wrote-javascript

JavaScript凭啥能吸引那么多文艺青年？说到它有限的语法所具备的表达潜能，我倒是有几点不成熟的想法，不过那是另外一个话题了。哎，如果那些大作家都喜欢上JavaScript，会咋样？你说他们会用JavaScript写出点什么东西来？作为海明威的十足拥趸，我的第一反应也是这老爷子不可能喜欢编程序（包括程序员）。话虽如此，我还是愿意相信在对它的各种非议中，其实潜藏着足以打动人心的一点：它是一门很文艺的语言，你说呢？它表面上简单粗陋、平淡无奇，而实质上却引人入胜、内涵十足。

代码审查之母

欧内斯特·海明威（美国作家）

``````function fibonacci(size) {

var first = 0, second = 1, next, count = 2, result = [first, second];

if(size < 2)
return "the request was made but it was not good"

while(count++ < size) {
next = first + second;
first = second;
second = next;
result.push(next);
}
return result;
}
``````

威廉·莎士比亚（英国诗人、作家）

``````function theSeriesOfFIBONACCI(theSize) {

//a CALCKULATION in two acts.
//employ'ng the humourous logick of JAVA-SCRIPTE

//Dramatis Personae
var theResult; //an ARRAY to contain THE NUMBERS
var theCounter; //a NUMBER, serv'nt to the FOR LOOP

//ACT I: in which a ZERO is added for INITIATION

//[ENTER: theResult]

//Upon the noble list bestow a zero
var theResult = [0];

//ACT II: a LOOP in which the final TWO NUMBERS are QUEREED and SUMM'D

//[ENTER: theCounter]

//Commence at one and venture o'er the numbers
for (theCounter = 1; theCounter < theSize; theCounter++) {
//By divination set adjoining members
theResult[theCounter] = (theResult[theCounter-1]||1) + theResult[Math.max(0, theCounter-2)];
}

//'Tis done, and here's the answer.
return theResult;

//[Exuent]
}
``````

安德烈·布勒东（Andre Breton，法国诗人和评论家，超现实主义创始人之一）

``````function Colette(umbrella) {
var staircase = 0, galleons = 0, brigantines = 1, armada = [galleons, brigantines], bassoon;
Array.prototype.embrace = [].push;

while(2 + staircase++ < umbrella) {
bassoon = galleons + brigantines;
armada.embrace(brigantines = (galleons = brigantines, bassoon));
}

}
``````

罗贝托·波拉尼奥（Roberto Bolano，智利诗人和小说家）

``````function LeonardoPisanoBigollo(l) {

if(l < 0) {
return "I'd prefer not to respond. (Although several replies occur to me)"
}

/**/

//Everything is getting complicated.
for (var i=2,r=[0,1].slice(0,l);i<l;r.push(r[i-1]+r[i-2]),i++)

/**/

//Here are some other mathematicians. Mostly it's just nonsense.

rationalTheorists = ["Archimedes of Syracuse", "Pierre de Fermat (such margins, boys!)", "Srinivasa Ramanujan", "Rene Descartes", "Leonhard Euler", "Carl Gauss", "Johann Bernoulli", "Jacob Bernoulli", "Aryabhata", "Brahmagupta", "Bhaskara II", "Nilakantha Somayaji", "Omar Khayyám", "Muhammad ibn Mūsā al-Khwārizmī", "Bernhard Riemann", "Gottfried Leibniz", "Andrey Kolmogorov", "Euclid of Alexandria", "Jules Henri Poincaré", "Srinivasa Ramanujan", "Alexander Grothendieck (who could forget?)", "David Hilbert", "Alan Turing", "von Neumann", "Kurt Gödel", "Joseph-Louis Lagrange", "Georg Cantor", "William Rowan Hamilton", "Carl Jacobi", "Évariste Galois", "Nikolay Lobachevsky", "Rene Descartes", "Joseph Fourier", "Pierre-Simon Laplace", "Alonzo Church", "Nikolay Bogolyubov"]

/**/

//I didn't understand any of this, but here it is anyway.
return r

/**/

//Nothing happens here and if it does I'd rather not talk about it.
}
``````

查尔斯·狄更斯

``````function mrFibbowicksNumbers(enormity) {
var assortment = [0,1,1], tally = 3, artfulRatio = 1.61803;

while(tally++ < enormity) {
//here is an exceedingly clever device
assortment.push(Math.round(assortment[tally-2] * artfulRatio));
}

//should there be an overabundance of elements, a remedy need be applied
return assortment.slice(0, enormity);
}
``````

“要是让我们冒险评价一下他的文学成就，可以称他为最肤浅的小说家。没错，这么说等于把它归入了他所处的文学领域的低等行列，但我们愿意承认这一点。把狄更斯先生归入最伟大的小说家之列，我们是过意不去的。因为他除了人物角色，并没有创造其他任何东西。他没有对我们理解人物角色多给任何资料。”

——亨利·詹姆斯谈查尔斯·狄更斯，评《我们共同的朋友》，1865年12月21日