Live data from Hacker News

If Hemingway wrote JavaScript

byfat.xxx

41–50 of 88 posts

Re: If Hemingway wrote JavaScript

#41
post #29
post #13

This is cool as a joke, but I don't think code should be compared to writing. 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. 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 an…

I disagree. I think the best writers work precisely like the best coders. They don't compromise on a single letter, they ruthlessly rewrite and refactor their own work as many times as they need to, and they value simplicity, elegance, and effectiveness. The main difference isn't the method, it's that writers usually get a lot more time to do their work. Tangentially, I believe that learning to write better will make…

> They don't compromise on a single letter

+1. I think that's why the Hemingway snippet works so perfectly. The tone both perfectly captures Hemingway's voice, and the design qualities of beautifully engineered code.

> I believe that learning to write better will make you a much better coder and communicator.

And again, yes.

Re: If Hemingway wrote JavaScript

#42
post #3

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.

I don't think that is true, what will happen is people browsing hackernews from work (in not particularly liberal work places) will not be able to read posts. Even if people choose to (incorrectly) use the .xxx extension I don't think it's going to push people to stop assuming .xxx is pornographic. edit: assuming you're not being sarcastic, can't tell.

Oddly enough, not blocked by SonicWall (at least in our config, which I would assume is fairly default-ish).

Re: If Hemingway wrote JavaScript

#43
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).

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.

(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.)

[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.]

Re: If Hemingway wrote JavaScript

#44
post #23

I don't know Hemmingway, but given this description: "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." I am not sure why he did not choose this style: function fi…

Just pulling quotes from the Wikipedia page, "he avoided complicated syntax and about 70 percent of the sentences are simple sentences — a childlike syntax without subordination."

Subordination is the key word, ie, limiting the amount of nesting. That's why the for quoted above is out, since there are two statements and an expression nested inside the for statement (i=2, iGoing out on a limb, I'd say Hemmingway's writing is building up complex narrative using simple building blocks. The body of the for loop above is a single line, which does simple arithmetic, array indexing, and a method call all together. In contrast, each line in the while loop body does roughly one thing: first addition, then assignment, assignment again, then a method call.

Re: If Hemingway wrote JavaScript

#45

Vonnegut. Beautiful except for this omission. Anyone?

Vonnegut would tell you the return value in the first line and then spend the rest of the function showing you how he got there.

Like this?

    function fibs(size) {
      return f();
      function f() {
        ... implementation here ...
      }
    }

Re: If Hemingway wrote JavaScript

#46

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). 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. (if yo…

It seemed like a pretty obvious reference to 2666 to me. The first part of the book has a number of dream sequences where its characters will just list off philosophers and put them into groups and connect them with lines. Definitely took me a few days to get through that book.

Re: If Hemingway wrote JavaScript

#48
post #3

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.

I don't think that is true, what will happen is people browsing hackernews from work (in not particularly liberal work places) will not be able to read posts. Even if people choose to (incorrectly) use the .xxx extension I don't think it's going to push people to stop assuming .xxx is pornographic. edit: assuming you're not being sarcastic, can't tell.

It was automatically blocked by my work filter as porn. First time I've even noticed a .xxx extension, and I didn't notice it until I noticed it was blocked.

Re: If Hemingway wrote JavaScript

#49
Top post HN (check), interesting title (check), innocuous title (check) -- click -- "Blocked by Security Policy" (huh?)-- .xxx domain? wtf! damnit! now i have an xxx domain logged to my corporate login... EXCELLENT. thanks.

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?

Re: If Hemingway wrote JavaScript

#50
post #23

I don't know Hemmingway, but given this description: "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." I am not sure why he did not choose this style: function fi…

I highly recommend: The Sun Also Rises (1926)
Post reply on HN