Quantum Mechanic

Content tagged Links

Literary Programming

posted on 2012-11-15 21:27:40

I've been doing a terrible job of writing recently -- something I'm happy to put down to the general depressing-nature of the life of the unemployed -- and I'm definitely overdue on some writing. I've now moved out of Washington Heights in New York, and into Evanston, just north of Chicago. So far I'm liking it here. It's similar enough to New York City in a lot of ways, but with much more space, and less of the claustrophobia that is endemic in NYC.

Now that I've reached a moment of coherence, I'd like to just throw down a link I thought was particularly interesting.

If Hemingway Wrote Javascript

This was notable for a number of reasons.  First, it was an entirely new genre of thing to me.  I had never seen anyone write about writing styles in programming before.  I don't mean style guides or best practices, but just what you express by the way you choose to do things.  I think the author did something really cool here, ranging from his interpretation of Hemingway, who wrote a very clear, straightforward implementation, to the different failings of programming style he showed in some others.

Even though the example of Breton is obviously written to be a bit silly, framing it as an author made me think about the example in a different light.  I'm a fan of work of the Dadaists, who did strange things because things are strange and the things we are used to only seem normal because we are used to them.  The idea of renaming the push() function of arrays to something else -- maybe even something more expressive -- strikes me as potentially helpful.  In languages where the language itself can be dynamic, as in Lisp or Javascript (and I'm sure others, I just only know what I know), maybe it makes more sense sometimes, to rename things to reflect what they're being used for.  If Lisp has taught me anything, it's that programming is just code manipulating data, and trying to render that clearly is the greatest struggle.

Finally, I can't leave this without mentioning the work of the imagined Dickens, who is someone I found very frustrating to read.  I consider A Tale of Two Cities to be one of the worst books I've read, and it was only through sheer will that I finished it at all.  Apparently, as quoted in the article:
If we might hazard a definition of his literary character, we should, accordingly, call him the greatest of superficial novelists. We are aware that this definition confines him to an inferior rank in the department of letters which he adorns; but we accept this consequence of our proposition. It were, in our opinion, an offence against humanity to place Mr Dickens among the greatest novelists. For, to repeat what we have already intimated, he has created nothing but figure. He has added nothing to our understanding of human character.

What I mean with all of this, and think of A Tale of Two Cities and the imagined Dickens implementation of the Fibonacci function is that they each manage to be what they set out to be -- a novel and a function -- but just in the meanest sense of the words.  A Tale of Two Cities has a story -- but only in that it relates a series of related events -- and the function returns the right function and in both cases, I feel like I'm squinting at them with, "That's not quite right," on the tip of my tongue.