sexta-feira, outubro 31, 2014

Code Belters from Hell: "Geek Sublime: Writing Fiction, Coding Software" by Vikram Chandra

Geek Sublime: Writing Fiction, Coding Software - Vikram Chandra

(my 3-volume-battered-copy of Donald E. Knuth's bible)

A long time ago when I was doing Software Engineering professionally (I was a C/C++ black belt coder back in the good old days of obfuscated coding practices…) I always of very keen to put lots of style and readability into my code. Then I moved on because I wanted my code to be beautiful as well. It took me longer to write agreed, but it was more pleasing to the eye and the brain. From that time on I’ve always considered Software Engineering and programming in particular, to be a creative art, which for me necessarily involved aesthetics. Unfortunately some people considered aesthetics the enemy of the pragmatic, which was a view I’ve never been particularly fond of. I used to argue at the time that my sense of beauty served pragmatism much better, because it lead to more concise and maintainable code, and was thereby far more effective. I still believe this to this day, even though I haven’t created professional source code for a long time. Now I only do it at home and just for fun. And for that I use Python, which has been my programming framework of choice in recent years, because of its high readability (vide “The Zen of Python” by Tim Peters). It satisfies all my aesthetic views on this subject. I know it’s not an industrial language (eg, the versions for Android leave a lot to be desired), but from the aesthetic point of view it’s one of the most eye-catching programming languages I know, and I know a lot of them.

I still remember the thrill of having written my first Basic code back in the 80’s in my still working Spectrum. When I saw it, it opened my eyes and my life was changed forever.

10 PRINT "HELLO WORLD"
20 GOTO 10

I know, I know. You’re all laughing in the back row, but you must remember it was the harbinger of a profound change in the way I think to this day. It shaped who I’m today.

In (obfuscated) C++ code the above would look something like this:

Class Program
{
                    Public static void
                    Main()
                    {
                                         System.Console.WriteLine(“Hello World!”);
                    }
}

In python I’d simply write ‘print “Hello World”’ (without the outer quotes). How simple can it get?

I was never quite sure why many programmers seemed to think their main objective was only to write code that only made things work. For me the job was dual: solve a problem with code in the most elegant way, such that your solution is easy to adapt, modify and reuse. Just like “Lisbon is a beautiful city” is not literature, although it might perfectly describe my feelings about the city I live in and love, coding something that just works is not programming. It’s another thing altogether. There are several terms for that. I’ll just use the polite one. “Dabbling”.

If painting is an art, why shouldn’t coding be? If what I do in my living room painting-wise is not art, it doesn’t mean it can’t be art. It’s all in the hands of the artist, in this case me (painting is not for me…). If I were a painting artist, ie, If I were able to apply paint in an artful way, I’d be an artist (in this book there’s a very interesting comparison between “The Hacker” and “The Painter”, which rang true to my finely attuned ears…). Likewise Software Engineering/Programming is usually art in the right hands. Unfortunately most software on the market today seems to have been written by the “Code Belters from Hell”... And there's a market for that. Hence, Visual Basic and its “look-a-likes” (VBScript, Visual Basic .NET, etc).

If programming languages were to be considered formal dialects, albeit less flexible and less forgiving of ambiguity than natural languages, coders, like poets, should be able to manipulate linguistic structures, always searching for expressivity and clarity.

Even though a piece of code passes instructions to a computer, its real target are the coders who will add features and remove bugs after the first versions were created. Donald Knuth, one of the unsung heroes of Computer Science (one of my boyhood heroes when I was a coding as if there was no tomorrow), stated in my 3-volume-battered-copy (vide image above) that coders write code for other humans, not for machines, which is a common misconception in today’s new programming class of coders. It’s in this aspect that for me Coding closely resembles Art. It’s all in the eyes of the beholder, and not in the “eyes” of the machine. It’s what you can picture inside your brain that can be called art, not what’s on the outside. We call it art, because we are able to picture it as art, be it an astonishingly beautiful piece of code, be it a Van Gogh. It doesn’t matter what kind of object we’re looking at. “Art” is inside us.

A programmer may imagine that to get the job done is what code is supposed to do. One may be forced to believe that code is, at the end of the day, a series of commands issued to a machine. What more could you want it to do? Knuth has already answered it a long time ago: “Code must be absolutely beautiful” (my italics). It’s still one of my favourite quotes Computer-Science-Wise.

As a side note, Chandra’s perambulations through Indian literature (eg, Sanskrit) was an added bonus for me. I knew next to nothing about this. Now I know a little bit more. On top of that, the connection he makes between the ancient Indian poets of long ago and the way we should look at art it’s quite entrancing and convincing.

It was a real pleasure reading this book. It introduced something new to me and it did so in a very “geek-like” way. I got the impression it was written by a geek for geeks, but maybe I’m reading too much into it, being a geek myself. Yes, I confess: I was once an “Einstein” (as opposed to being a ”Mort” or an “Elvis” programmer), using Microsoft’s terminology for programmers lol. Unfortunately (or not), I'm no longer that...

NB: See my Adam Greenfield's book review for an extensive list of seminal works in terms of Computer Science (my opinion).

sexta-feira, outubro 24, 2014

Reality-behind-the-surface Literature: "The Assassination of Margaret Thatcher" by Hilary Mantel

The Assassination of Margaret Thatcher - Hilary Mantel
This is my first Mantel. I’ve been postponing reading the first two volumes of the Cromwell trilogy, waiting for the third volume to come out predictably in 2016. One does not tackle a twice-awarded-writer-with-the-Man-Booker-Prize without having everything in one big bundle to make a proper assessment...Nevertheless here goes my first take on Hilary Mantel, for what it’s worth.

One of my favourite things in life is reading that truly astounding book at the right juncture in time, ie, a book that mysteriously echoes and enriches my current thoughts. I think this was one of those (imperfect/perfect) books. There is a peculiar comfort in reading a book whose structures and operations mimic what, I think, literature should be all about. One of the things I like the most about literature is to read it and later on write about it. Literature for me is all about a set of interlocking conventions (a system), and how we can read this so-called system into something meaningful.

This short-story collection is a good example of this. First of all it’s a mixed bag, ie, we have The MagnificentThe So-and-So, and The-Not-So-Good (there are not really bad short stories here). What is immediately noticeable is Mantel’s use of language (the system). What better way to evaluate a write’s skills than in the shorter form? I’ve always stated that there’s no better way to “see” the inner skills of a writer. In the shorter forms the writer cannot hide behind the usual literary contraptions: plot, complex character development, etc.

In this aspect Mantel succeeds entirely, ie, her use of language drew me in, revealing the horror that just lies beneath the surface of our everyday life, to reveal the inner structure of reality, much like Gonçalo M. Tavares (vide review) is able to do:

 “I knew not to mention her name and the pressure of not mentioning her made her, in my imagination, beaten thin and flat, attenuated, starved away, a shadow of herself, so I was no longer sure whether she existed when I was not with her.” (From “Comma”)

“And we saw – nothing; we saw something not yet become; we saw something, not a face but perhaps, I thought, when I thought about it later, perhaps a negotiating position for a face, perhaps a loosely imagined notion of a face, like God’s when he was trying to form us; we saw a blank, we saw a sphere, it was without feature, it was without meaning, and its flesh seemed to run from the bone.” (From “Comma”)

"What I had taken to be stucco was in fact some patent substance newly glued to the front wall: it was grayish-white and crinkled, like a split-open brain, or nougat chewed by a giant." (From “How Shall I Know You, my favourite short story in this collection).

“I did my act on autopilot, except that when it came to my influences I went a bit wild and invited a Portuguese writer who I said knocked Pessoa into a socket hat. The golden young man kept invading my mind, and I thought I’d quite like to go bed with someone of that ilk, by way of change. Wasn’t everybody due a change?” (“How Shall I Know You”)

As I said, not all of the stories are successful. Sometimes we get the feeling that Mantel just ran out of steam by the end of some them, but the ones that work, oh my…Almost all of the short stories here are a wonderful example of the show-don’t-tell type; they show everything, almost, and tell nothing. What more can I ask for in a literary work? In this aspect Mantel belongs to the Gonçalo M. Tavares, António Lobo Antunes and Philip K. Dick lineage.

Without having read her other body-of-work, ie, having read only this collection, Hilary Mantel may be one of the best writers of her time, and there's no better evidence of her skills than this short-story collection. I’ll refrain from further praise. I’ll wait for the Cromwell trilogy to fully state my case.

Is it possible to name a writer as the best prose stylist of our time? Should the discussion be exclusively Anglo-centric? I think not. I can give two wonderful examples of writers writing in Portuguese, but with numerous translations in English, that in my mind could be real contenders for this elusive “prize”: Gonçalo M. Tavares (he pushes the boundaries of what fiction is or should be in a way I haven’t seen in a writer writing in English in recent years – vide review above), and António Lobo Antunes (I always thought that his writing is very god-like, ie, Lobo Antunes can write as if God himself were choosing the words for him; it all fits perfectly in his sentences).

I invite you to name a few writers having this “illuminating”, reality-behind-the-surface quality (in English or in any other language). Any thoughts on this? I’m curious to know.

sábado, outubro 18, 2014

"The Magus of Hay" by Phil Rickman

My favourite ghost-buster is back…well, back in late 2013, but only now was I able to read it.

I read more than most people, typically from fifty to a hundred books a year, and it is unfortunate that there are enough absolutely first-class books around that I'm not going to have time to finish them all. I won't even get close. Shame on me. That’s why I sometimes feel guilty to spend some time with books that at first seem to be entirely frivolous. This impression is just that. An impression, a feeling. Fortunately the Merrily Watkins series is more than meets the eye. This makes me feel less guilty…

The Magus of Hay (Merrily Watkins Mysteries) - Phil Rickman
The Merrily Watkins novels present the failure to achieve an integrated world in terms of attempted transcendental journeys, as though into a better future. In a second category, usually signaled by someone’s arrival at a meticulously described house, the attempted rescue has already failed by the time the tale begins, and within the house will be discovered a ghost, a mummy, perhaps still breathing. One of the best examples of this category in this novel is Robin and Betty’s bookshop located on Hay-on-Wye in the Welsh border, which is the primary setting for the action, and as always, Rickman was able to wonderfully capture the local folklore. The anotherness of Hay is discussed intelligently throughout, and plays an important part in the story. In this respect the book works well.

Because of having fewer characters than usual (Lol and Jane are absent, Gomer Parry shows up only occasionally), Rickman has to compensate by giving Franny Bliss more action time. In consequence I’d have expected Merrily to be a more fully-rounded character, but she’s just the opposite. The problem lies with Merrily’s stream-of-consciousness narrative (or lack of it). Rickman has some problems when attempting to use stream-of-consciousness, particularly regarding Merrily’s inner voice: Is she talking or thinking? Who is talking? Can anyone in this book say what they mean, or are they doomed to refer en passant to something we may discover later on?

José Saramago was the master when it came to successfully using stream-of-consciousness. He was able to use long sentences and eschewing quotation marks to enhance the seamlessness of his prose, allowing the stream-of-consciousness to run free of interruption. Rickman’s command of language is not so finely honed. His use of this literary device seems confusing at times.

Despite the obvious shortcomings, I always come back for more. Why is that? Is it the yearning for a cup of cider, the sight of a magnificent ancient tree, the atmosphere of a country church, or just the exhilaration of discovering something new in the countryside? It does not matter what life throws at you. I always have a good time when I’m with Ledwardine’s ghost-buster…

NB: The Merrily Watkins series 12th installment .

sábado, outubro 11, 2014

"Robert A. Heinlein, Volume 2: In Dialogue with His Century: 1948-1988: The Man Who Learned Better" by William H. Patterson Jr.

Robert A. Heinlein: In Dialogue with His Century Volume 2: The Man Who Learned Better - William H. Patterson Jr.
 
 (my own Heinlein personal library)

Disclaimer: I was recruited into my professional career by reading Heinlein in my formative years, especially the juveniles. I didn’t even pretend to be unbiased when writing this. So read on at your own peril.    

When modern SF began, there were two kinds of SF writers: those who broke into print at the top of their powers, like Burroughs and Van Vogt, and those whose later work showed significant improvement. In spite of Heinlein’s early reputation, his writing grew steadily in skill and power, particularly in stories at the longer lengths. Heinlein’s early stories were better than those of a beginner, perhaps because he was 32 when he started, but they were appealing more for their philosophy, toughness, and ability to evoke societies economically than their narrative skills. This is not to say that Heinlein did not publish significant fiction in his early years. He soon was producing short stories of revolutionary insight and developing artfulness: “Coventry”, “The Roads Must Roll…”, “The Long Watch”, “Solution Unsatisfactory”, “The Man Who Traveled In Elephants”. I still remember my first reaction when I read “The Puppet Masters” (first in Portuguese, and later on in English):”Oh, no! not the parasitic aliens again!” And then my surprise faded into admiration at the way Heinlein had rejuvenated that ancient idea. Heinlein had a talent to rehash old ideas and making them new again: solipsism, time paradox, immortality, superman, you name it. His skill made the parasitic aliens the reader’s nightmare as well.
In Heinlein’s body of work I always came across a great deal of process. I always sensed that Heinlein himself was fascinated by the way things were done and had one hell of a kick by describing it (eg, the way spaceships fly, the way revolutions are made, the way society works). Process makes fascinating reading when it’s properly handled, ie, when it’s implied rather than lecture about (eg, in the short story “Universe” the process by which reality becomes myth is implied by the way the reality of the self-contained spaceship is translated into religious imagery). Is “The Puppet Masters” just an adventure novel? Not by a long shot. It’s also aBildungsroman. The main character’s competence evolves throughout the novel.

I’ve seen and read lots of Heinlein bashing regarding the competence (or lack of it) issue. It just seems elitist and is sometimes condemned .by people who are committed to democracy and a belief in the collective wisdom of the people under any circumstances. My reading of this issue is that many fail to see that Heinlein’s worlds are worlds in crises. Civilization are threatened, and competence is the single important quality. What would be the qualities Heinlein would value in a world without crises? It’s anybody’s guess. It’s not in Heinlein’s scope. 

I haven’t read Heinlein in a long time. When I was actively reading everything I could lay my hands on about him, I started to get the feeling that the more I looked into his work, the more difficult he was to pin down. After reading more than 1300 pages (2 volumes) of his biography, I can surely understand why that is. 

Patterson’s 2-volume take on Heinlein is not top-notch, but to dismiss it as a failed biography – because literary critique and close reading are missing, because of its open fandomness, and so forth – would be to deny by omission the translucent, effortless ephiphanousness of both books, which resides less in its nature as biography than in the fact that it reads as a kind of elated fannish elegy regarding Heinlein. As a fan myself this is the book that I’d have liked (almost) to have written.

Bottom-line: If you are an Heinlein fan read the 2 volumes. I won’t promise you’ll get an unbiased account of Heinlein’s life; if you are not an Heinlein fan, read it anyway. You’ll get to hear the Old Man’s voice through numerous letters. That’s a real treat all by itself.

NB: In own “my personal” Heinlein library I always pretend that the books after “Time Enough for Love” (including “The Number of the Beast”) were never published, and go re-read again “Citizen of the Galaxy”(my personal favourite), “The Past through Tomorrow”, ”Have Space – Will Travel”, “Double Star”, “The Star Beast”, “Red Planet” (uncut edition), “The Moon is a Harsh Mistress”…


NB: SF = Speculative Fiction

"Robert A. Heinlein: In Dialogue with His Century: Volume 1 (1907-1948): Learning Curve" by William H. Patterson Jr.

Robert A. Heinlein: In Dialogue with His Century: Volume 1 (1907-1948): Learning Curve - William H. Patterson Jr.
For the complete Patterson review of the 2-volumes biography, see review.

I’ve selected a few texts in direct speech, to illustrate some of his ideas, which I think worth retaining, because they help us understand the man as well as the writer (many more could have been extracted).

Volume 1:

  1. “How long this racket has been going on? And why didn’t anybody tell me about it sooner?” (when Heinlein made the first sale to Campbell: “Life-Line”)
  2. “I have been writing the Horatio Alger books of this generation, always with the same strongly moral purpose that runs through every line of the Alger books (which strongly influenced me;  I read them all):
  • “Honesty is the best policy.”
  • “Hard work is rewarded.”
  • “There is no easy road to success.”
  • “Courage above all.”
  • “Studying hard pays off, in happiness as well as in money.”
  • “Stand on you own feet.”
  • “Don’t ever be bullied.”
  • “Take your medicine.”
  • “The world always has a place for a man who works, but none for the lazy.”
These are the things that the Alger books said to me, in the idiom suited to my generation; I believed them when I read them, I believe them now, and I have tried to say them to a younger generation which I believe has been shamefully neglected by many of the elders responsible of its moral training.” (now we understand where the “competence” theme comes from…)

Volume 2:

  1. Heinlein had two ambitious in life: to go to the moon and to meet Dorothy Lamour.
  2. “Let me take time to make it clear that I regard McCarthy as a revolting son of a bitch, with no regard for truth, justice, nor civil rights – also that I think his purposes were demagogic and personally ambitious, not patriotic. All clear?”
  3. “This genre is not a sub-genre of adventure fiction (even though many of the tales in it are adventurous)… This field is concerned with new Ideas, new possibilities, new ways of looking at things… which is precisely why it is so attractive to young people and so little read by older people, ie, read only by those who have kept their minds young. Now if a story does not take the cultural framework we live in, stretch it, twist it, turn it upside down and examine it for leaks, rearrange the parts and see how they would relate in a new arrangement – in short, explore possibilities and play games with ideas – it is not really a story of this genre at all but merely a western translated into the wider open spaces of the stars.”
  4. “Speculative fiction is much more realistic than most historical and contemporary scene fiction [mainstream] and is superior to them both.”
  5. “One is the notion that knowledge is worth acquiring, all knowledge, and that a solid ground in mathematics provides one with the essential language of many of the most important forms of knowledge. The third theme is that, while it is desirable to live peaceably, there are things worth fighting for and values worth dying for – and that it is far better for a man to die under circumstances that call for such sacrifice. The fourth theme is that individual human freedoms are of basic value, without which mankind is less than human.”
  6. “Some critics say that my stories always contain a wise and crusty old man who is my own concept of myself. Not true. They are all different and they are not self-portraits; there are many men who indeed lived and who were my mentors – and now they are all gone to whatever Valhalla there may be for such men…”
  7. “If you make people think they’re thinking, they’ll love you; but if you really make them think, they’ll hate you” (Don Marquis)