TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

If Hemingway wrote JavaScript

218 点作者 federicoweber超过 12 年前

32 条评论

monatron超过 12 年前
Top post HN (check), interesting title (check), innocuous title (check) -- <i>click</i> -- "Blocked by Security Policy" (huh?)-- .xxx domain? wtf! damnit! now i have an xxx domain logged to my corporate login... EXCELLENT. thanks.<p>Really though... Is there some sort of clever reason why this person's blog is on a xxx domain aside from annoying people like myself stuck behind corporate proxies?
评论 #4607213 未加载
评论 #4607009 未加载
jrockway超过 12 年前
Excellent use of the .xxx domain name. If people start using .xxx for normal writing, the concept of "one place to conveniently censor" will not work out. Heh.
评论 #4606477 未加载
评论 #4606664 未加载
评论 #4606467 未加载
评论 #4607415 未加载
lmm超过 12 年前
Am I alone in finding this ridiculously pretentious? I got as far as the mocking olde-worlde "shakespeare" comments before giving up.<p>Javascript is not a better language than others (in fact it's a far worse language), and it's downright insulting to put words in the mouth of someone like Hemingway to try and make yourself feel better.
评论 #4606843 未加载
评论 #4606840 未加载
brudgers超过 12 年前
<p><pre><code> return result; } </code></pre> That happy ending is not Hemingwayesque.
angusC超过 12 年前
If anyone wants to add Vonnegut or anyone else please feel free to fork my original code. No reasonable pull request refused :-)<p><a href="https://github.com/angus-c/literaryJavaScript" rel="nofollow">https://github.com/angus-c/literaryJavaScript</a>
评论 #4607753 未加载
DanI-S超过 12 年前
This brings up a sore point, for me.<p>I love to read. At some points in my life I have been able to read two or three books every week. I have spent years of time drifting through the endlessly multiplicating realities of prose.<p>However: since moving to the Valley, working full time whilst attacking various business and development side projects, I can usually manage 2-3 pages (immediately before bed).<p>Where do you find the time to read?
评论 #4607614 未加载
评论 #4607909 未加载
JasonFruit超过 12 年前
If the "Closing Thoughts" express the <i>point</i> of his amusing and mostly well-executed exercise, then for all his skill it's a wasted effort. It's precisely "doctrine and dogma", "rulebooks and boilerplate", that make JavaScript work for group development and long-term maintainability.<p>This is the coding equivalent of the garage musician who says, "Don't bother me with rules — I'm playing pure <i>emotion</i> here, man!"
评论 #4607250 未加载
评论 #4608339 未加载
评论 #4607199 未加载
andrewcooke超过 12 年前
the code for the bolaño one is not so good, although the explanation improves it (i think all the others snippets give you a fair idea of what to expect in a book by the author; that really doesn't).<p>when i first skimmed the article i got down to that section, read the code, with a list of names, and expected something french and post-modern. was really surprised when i checked back to the title to see bolaño.<p>(if you haven't read him, i wouldn't start with 2666, but with the savage detectives, which is a really sweet, funny, smart novel. also, if you speak spanish as a second language, he's very easy to read in the original - a modern, simple, colloquial style, just like you're used to speaking.)<p>[edit: huh; i don't even remember the dream sequences at the start of 2666, so maybe my bad. will have to go back and re-read. edit2: oh, yeah, i do remember. ok... but there's nothing like that in any other book of his i have read. hmph. you might as well characterise his writing as a list of murders.]
评论 #4606918 未加载
ajuc超过 12 年前
Great post, but I don't agree with the critique of "Dickens'" solution.<p>Using one-step equation to solve iterative problem is IMHO better (obvious speed benefits for large n, the only drawback is floating point imprecision), and deriving the equation requires deeper understanding of the problem than simply modeling the iterative equation with a loop.
评论 #4606747 未加载
评论 #4606735 未加载
Charlesmigli超过 12 年前
Very well written article. Conclusion is very sharp, I like it. I tried to make the tl;dr version but it's definitely worth reading the full article <a href="http://api.tldr.io/tldrs/506c2f7991598c0f55000098" rel="nofollow">http://api.tldr.io/tldrs/506c2f7991598c0f55000098</a>.
eevilspock超过 12 年前
Vonnegut. Beautiful except for this omission. Anyone?
评论 #4606767 未加载
Void_超过 12 年前
This is cool as a joke, but I don't think code should be compared to writing.<p>For example I am an engineer, so this comment is written like code. It contains just enough words to express my point, it's clearly structured and my goal is to make it easy to read.<p>That's okay writing, but far from great. Great writers can just sit down and write amazing text. I could never do that. I have to go back, read after myself and refactor.<p>I wonder if other engineers feel similarly.
评论 #4606647 未加载
评论 #4606780 未加载
评论 #4606791 未加载
评论 #4607240 未加载
评论 #4607774 未加载
评论 #4607626 未加载
Ygg2超过 12 年前
My antivirus has found Mal/HTMLGen-A virus on this page. Has anyone verified this is legitimate? The domain .xxx doesn't inspire much confidence either.
评论 #4606475 未加载
nadam超过 12 年前
I don't know Hemmingway, but given this description:<p>"No surprises here. Code reduced to its essentials with no word or variable wasted. It’s not fancy; maybe its even a little pedantic - but that’s the beauty of Hemingway’s writing. No need for elaborate logic or clever variable names. It’s plain and its clear and it does what it has to - and nothing more."<p>I am not sure why he did not choose this style:<p><pre><code> function fibonacci(size) { var result = [0, 1], i; if(size &#60; 2) return "the request was made but it was not good" for(i=2; i&#60;size; i++) result.push(result[i-1] + result[i-2])); return result;</code></pre> }<p>Perhaps because Hemmingway would care about performance?<p>-----<p>Slightly related: One year ago Javascript inspired me to write the javascript version of genesis:<p><a href="http://nadamhu.wordpress.com/2011/09/29/javascript-genesis/" rel="nofollow">http://nadamhu.wordpress.com/2011/09/29/javascript-genesis/</a>
评论 #4606911 未加载
评论 #4606800 未加载
评论 #4607003 未加载
habosa超过 12 年前
Pretty sure Shakespeare would not use JavaScript at all, but rather this:<p><a href="http://en.wikipedia.org/wiki/Shakespeare_(programming_language)" rel="nofollow">http://en.wikipedia.org/wiki/Shakespeare_(programming_langua...</a>
pron超过 12 年前
<i>Even as a long-time Hemingway nut, I’d be the first to admit that Papa would probably have loathed programming (and programmers).</i><p>You got that right.
syaz1超过 12 年前
How were you able to repost this? I see similar URL. I know because when I tried to post this before I got redirected to a submission... probably this one: <a href="http://news.ycombinator.com/item?id=4336148" rel="nofollow">http://news.ycombinator.com/item?id=4336148</a>
timje超过 12 年前
I love this post, it reminds me a bit of the Mark Crick's 'Sartre's Sink' series of books.
richardofyork超过 12 年前
I love Literature as well as JavaScript, too. Here is a literary JavaScript post that is a fun read: <a href="http://javascriptissexy.com/javascript-is-super-sexy/" rel="nofollow">http://javascriptissexy.com/javascript-is-super-sexy/</a>
Fletch137超过 12 年前
As a book nerd myself (and a lover of JS), I really enjoyed that.I think the criticism of Dickens was undeserved, even if it was a quote - but the Shakespeare iteration was spot on, loved it.
Millennium超过 12 年前
My problem with the Hemingway one is that there's not nearly enough function call chaining going on. Hemingway would be all over that particular construct.
tnuc超过 12 年前
Dickens got paid by the word. I would expect a lot more code that does nothing.
russelluresti超过 12 年前
I'm gonna go with the Bard's. Not for the solution, but for the comments.
thomasfl超过 12 年前
TLDR; Doing javascript like Douglas Crockford is boring.
dschiptsov超过 12 年前
..it would be Scheme.<p>or, well, Arc, which, I think, is already obese.)
leif超过 12 年前
Of course, writers would all consume linear space.
stylewalker超过 12 年前
What is that CMS i see more and more often?
评论 #4606752 未加载
tomchristie超过 12 年前
The Hemingway snippet is genius. Spot on.
calvin超过 12 年前
Can anyone provide a SFW link for this?
suprawsm超过 12 年前
Wow, I really enjoyed this post.
frenchfries超过 12 年前
this guy needs more xxx ...
atdt超过 12 年前
Christ, what an asshole.