and has 0 comments
Yes! Another good sci-fi book. Blindsight is a hard science fiction standalone novel in which, using the idea of contact with an impossibly alien species as a pretext, Peter Watts discusses hard subjects like the future of humanity and its very definition, the nature of conciousness and the difference between intelligence and self awareness. It also features vampires (ugh!), but with a good scientific background and true relation to the plot.

There is no romance in this bleak and autopsic book, where the essence of all the characters gets dissected to complete the tableau of the human race under cold fluorescent lighting. Good stuff! But one gets to expect this from Canadian writers, eh? :)

The other cool reason why you should read the book is that it is free at Watts' site: Blindsight. Enjoy!

and has 0 comments
The Legacy of Heorot is a good sci-fi book, part of yet another trilogy: Heorot, written by no less than three authors: Larry Niven, Jerry Pournelle, and Steven Barnes. You've heard of Niven by way of Ringworld, the others are no first time writers either, but I have frankly never heard of them.

The book is about a colony of people on the fourth planet of Tau Ceti. They call it Avalon and the colony Camelot, declaring their ideal of an honest equalist society that has the good of the people at heart. But of course, as the title of the series suggests, the plot moves towards the story of Beowulf rather than any round table. In face of doom and disaster, people tend to go through standard phases, starting with denial, while any façade of equality and reason quickly crumbles.

And this above paragraph pretty much details the subject of the book as well as the reason why I was partly disappointed with it. I was afraid that the story would be yet another actualization of the myth of Beowulf, which would have bored me to hell, but it wasn't. Yet it wasn't really a strong psychological or social commentary either. More of an optimistic view of the first human interstellar colony. Like any government or corporation would spend a whole lot of money on a space ship, in order to send it to another planet and then made it a present to the crew of the ship, fire and forget like. (See how I start and finish sentences with "like", I'm pretty rad, huh?) And all the people there, selected by a well designed process, would be nice and intelligent and having no social pathology at all.

But the book is nice enough, regardless of my bleak and neurotic projections. It focuses on the planet's (very simple) ecology and the way the colonists interact with each other and fight for their prize. They have colonized a small island in order to minimize threats, but there is a huge unexplored continent waiting for them, therefore the trilogy. It was nice, though, that the first book is rather standalone. If you choose to read it and you do not want to continue the series, there is no hook at the end, it just satisfactorily finishes all that was started.

and has 1 comment
I was searching for horror books and I tried this list from a book site. Little did I know that the asshole that wrote the list had a vampire fetish and so he listed all the books with vampires that he ever read.

Blood and Magic, by Lena Austin, is not a horror book, it's an adult fantasy book where sexy vampire bitches have sex with magical and well endowed unicorns. That should say enough about the book, and yet I have read it. It was easy to read, being a short single threaded narrative that had the only purpose of getting the main character (said red headed vampire girl) well fucked, respected and pretty much anything she wanted. I am sure sometime in the future will be discovering that she is also a princess of sorts.

This ends my review.

and has 0 comments
Yes, it's that Guillermo del Toro and he wrote a book, together with this Chuck Hogan dude. Actually he wrote more books, this is part one of the Strain trilogy which, judging by the name, should have been about either a contagion or some sort of pulled muscle, but instead is about vampires.

Now, I don't want to be mean towards poor Guillermo. Vampires, even if really overdone nowadays, are pretty cool. The ones in the book are not even sparkling or talking with a Russian accent, but are vicious creatures that have in mind only one thing: to feed. That makes them the more believable type of vampire, although the technical details that are trying to explain in scientific terms the process of vampirification are complete rubbish.

The book is about a contagion of sort, that of vampirism. A "master" comes in New York (where the hell else), wreaking havoc and turning everybody to vampires. They even say this type of vampire is a virus incarnate, although the analogy gets a little strained (get it?). An old Jew is the only one who knows what vampires truly are and how to fight them and he teams up with this New Yorker epidemiologist (and later a pest control rat hunter second generation Russian) in order to fight this asshole vampire.

This melange of different cultures gives opportunity to talk about the Holocaust and 9/11 and even Romania, all at the same time! The writers shamelessly abuse this without actually connecting these facts with the story in any significant way. That bothered me. I understand people can become a little obsessive over things like this, but what kind of a jerk keeps using them to further their careers and books? Anyway, before turning this into another "stop using Hitler, the Holocaust and 9/11 as arguments" extension of the Godwin law, let's get on with the book.

The writing itself is not bad. The only things that kept me getting out of the atmosphere of the book (except the shamelessness above) were some of the emotional background stories used to describe the beginning of the infestation. I would blame that on me, though, as I am often prone to get annoyed by the feelings of others, especially when they get in the way of a good storyline.

Being a trilogy, the book doesn't really end at The Strain. It's just a broken shard of a whole story. You get some hints on what would happen and also some of the arches are closed by the end of the book, so it isn't completely annoying.

Bottom line: Hmm, it was good, not really a masterpiece. It reads like a movie, with a simple almost linear plot. The thing is that, even if it managed to convey the terror of such an occurrence in general, it didn't really evoke in me feelings of horror or at least some empathy with characters that feel that horror, and that is what I was looking for. I've read the book in under a week, but I am not really prepared to spend another two reading the continuation.

and has 0 comments
It is hard to describe House of Leaves in relation to any other I have read before. It is clearly a masterpiece, a mad foray into personal darkness and schizophrenia, maybe Mark Z. Danielewski's (it is certainly difficult to imagine a non-extraordinary person writing this).

What is it about? At the surface, it involves a guy that works in a tattoo parlor finding some old papers in the apartment of a blind old man and getting obsessed by them. You see, this old man has written an extensive analysis of a house made movie than was released to critical acclaim and that was viewed and analysed by a lot of others. Only the film does not exist, the references are mostly bogus and the people that happen to be real deny any connection with this fictitious film.

Now, the old man, Zampano, has died in a house that was sealed from the outside, with various implements used to cover every open bit from the door and windows. Now Truant, the tattoo guy, is reading the Zampano papers and starts to get similarly affected, being overwhelmed by a subtle horror emanating from the old man's writing.

The film itself is about a guy, Navidson, a famous international photographer, who decides to move with his family to a new house, a gesture of healing and reconnection, as his job often took him away from his wife and two children. This house, though, has a secret. Suddenly, there is a corridor in one of the walls of the house. It is terrifying through his deep black color and the fact that the wall is an exterior wall and no evidence of its space is visible from outside. More than that, the corridor twists randomly and seems to go forever, even changing configuration.

These are not the only dimensions of the book. Indeed, the fact that a terrifying hole in a wall exists in their family home terrifies the wife, who forbids anyone going in there, under the threat of leaving. Navidson, though, an explorer and a man dedicated to committing the world to photo and film, feels the need to explore it. The very house that was supposed to bring the family together, breaks it apart.

Zampano's notes are comprehensive, academic, with references from linguistics, physics, philosophy, psychology and literature. They contain numerous quotes from documents and books written about the film. The notes have a lot of footnotes, that contain not only more details about the analysis, but personal ideas and emotional outbursts.

Now, Truant is not really a scholar, but he transcribes all of Zampano's work and adds his own notes, together with the story of the document and bits of his personal life. He does drugs, goes clubbing and has a lot of sex, all while obsessing over his bosses girlfriend. But it is not enough to switch him from his transcribing work and the dark effects this has on him.

And that's not all, either. At one time a foot note describes Truant going into a random bar and hearing a band singing about something in Zampano's notes. He asks the members of the band and they show him the published version of the House of Leaves, by Zampano, annotated by Johnny Truant. Truant starts seeing more and more horrible versions of his own life, only to switch back to reality and not be sure which is which.

The book itself is written in 3 different colors, emphasizing Truant's and Zampano's notes. The references are often insane, hyperanalysing a single quote or sequence of the film through analogies with psychological complexes, Latin quotes and mathematical analysis of sound when it echoes. The notes often end abruptly and continue with Truant's story that itself ends with no discernible pattern.

However, the story somehow remains cohesive and the feelings of alienation and unspeakable, more: undefinable, horror transpire through the book. The early Truant drug trips go further in defining this weird combination of Lovecraft, Kafka and Philip. K. Dick.

Bottom line: this book is as brilliant as it is insane. I have never read a book like it and I can only bow to the immense effort of constructing it. It is itself like a dark corridor, ever shifting, and totally gigantic. You should read it.

Be forewarned, though, this is ergodic literature. To truly understand it, you need to read it on paper or in PDF form; OCR doesn't really work on this book and various rtf, doc, html versions you might find are probably close to unreadable.

and has 3 comments
I started reading The Stranger on a recommendation. A guy told me the main character was a bit like me. Having read the book there is only one question I want to ask: How did Albert Camus know about me in 1942?

Joke aside, this a rather short book detailing a bit of the life of a Frenchman that doesn't feel much, is a rational person and doesn't believe in God. Therefore everybody around him thought him a stranger, hence the title of the book. Camus has a way of writing this in the first person, but in a way that seems both introvert and totally outside. The character describes everything he sees in neutral terms, proving he is both very observant and completely indifferent. When other people talk, he quotes them, when he describes himself talking, the character is summarising to the minimum, with no quotes, giving the impression he is a stranger to himself, hence the title of the book.

In the end, it felt like the last part of the movie The Mist. The same irrational fear of the different, coming from a shapeless mass of mindless drones, blindly destroying everything. In my view, the character manages to maintain his decency by rejecting the smallest gesture of resistance. But what do I know?

Would I recommend the book? It certainly teaches the reader something. It describes a way of thinking and of being that is different from most people. It explores several philosophical schools of thought, but you wouldn't know about it unless you read Wikipedia :). It is short enough to not bother anyone, though. Why wouldn't you read it?

and has 0 comments
Greg Bear is the type of writer that I just have to love: he writes hard SciFi, but easy to read, he doesn't bullshit the reader with too much technobabble and, even if his writing is by no means simplistic, he doesn't bore you with how some person or another feels unless it propels the subject forward. Blood Music is also of a subgenre that I love: global pandemic, so I have to also love the book. So take that into account when you read my review.

The book starts with a preposterous idea: that cells can become intelligent. A brilliant scientist, but one that has always cut corners to get around, discovers this almost by accident and... well... cuts a few corners. The result is something that feels like John Saul's The God Project, but soon leaves it and reaches for the stratosphere. The end is typical Greg Bear, astounding and megalomaniac.

Blood Music has some flaws. One of them is that it is really a very short book, an extension of the original 1983 short story that won the Nebula. The other is that it is written in 1983 (similar to The God Project) and so the science background is both grandiose and a bit obsolete. But it is a good book and one that ponders on the significance of identity, thought, society and ultimately: the essence of reality. I've read it in about three days, so you have no possible excuse for not trying it.

and has 1 comment
I was in the mood for horror, something really disturbing and hopefully on the sci-fi side, and so I went scouring the net for good horror books. Origin, by J.A. Konrath, was suggested by some guy or another, so I started reading it.

The problem is that the book is not much more than an easy thriller. The writing doesn't suck, but neither does it shine; the subject is intriguing, but treated in a screenplay fashion, with not much depth and only a few characters; the book is easy to read and really short; the plot has numerous holes in it. But worst of all, it doesn't really scare! While some of the scenes were - let's say - gory, they were not horror, but rather expected consequences of previous actions.

What is it about? The United States government (who else, tsk, tsk, tsk) has found a strange sarcophagus while excavating the Panama canal. For a century the secret is kept and the subject examined in a specially built facility underground. In the sarcophagus is a massive creature with red skin, hooves, horns and wings. After 100 years of slumber, it awakens. What is it? A devil, THE devil, an alien, a strange prehistoric creature? You will have to read the book in order to get an answer to that question.

Bottom line: I read it in less than a week, didn't hate it, didn't love it, it was good for passing the time, but I would not recommend it for anything but a vacation, to read on the way or in other boring moments.


Programming Game AI by Example is one of those books that would have changed my life had I had read them when I was 15. Mat Buckland is taking a really high tech portion of game making and turning it into child's play. With source code!

From the very beginning we are being told that AI in games is different from what we would normally associate with Artificial Intelligence. AI in games is the thing that makes game agents look smart, but let the user enjoy the game the most. In other words, something that seems smart, but is just stupid enough for you to continue playing.

The book is comprised of ten chapters, heavy with code, but very well structured. The main tool in use are Finite State Machines, but we first get a mechanics physics lecture in chapter 1 where we learn what a vector is and how to normalize it and how to use this in the game physics. Moving to chapter 2, we learn what a state machine is and how to optimize memory by making each one a singleton, how to compose them and why more exciting aspects of artificial intelligence, like say neural networks, are not used more in games. We delve further into methods to optimize what we have learned to make it practical: prioritized dithering, partitioning, BSP, quad and oct trees, fuzzy-Q logic, cell space partitioning, all with code examples, in chapter 3. Chapter 5 is reserved for graphs, Dijkstra, A* and such. Chapter 6 goes into integrating Lua into your games, as a good tool to define and tweak the innards of your game before compiling it all for performance into a single code base. Raven, the example game engine, is detailed in chapter 7. Path planning is described in chapter 8, complete with many optimizations and tricks to make an algorithmic movement of units look natural and smart. Chapter 9 is about goal driven agent behaviour, where we learn how to make an agent define goals and act upon those goals. The composite pattern is suggested as a good solution for goals within goals. We end with a very interesting chapter about fuzzy logic. The basis of this is to fuzzify a situation, infer a behaviour, then defuzzify into a usable algorithmic value.

The bottom line is that this is a very easy book to read, explaining matter-of-factly how to easily create the intelligence in games like Fifa or Counter Strike. The code examples are extensive, but not necessary to understand the gist of things. At the end, it is both a fascinating and intriguing read as well as a good reference book for when you actually need this stuff.

I end this review with a quote from Dijkstra that was also mentioned in the book: The question of whether Machines Can Think... is about as relevant as the question of whether Submarines Can Swim. Very nice book and a recommended read.

and has 0 comments
I started reading The Passage because of an Internet review. It was so exuberantly positive that I thought I would have a great time reading the story. It said "I don’t think I’m exaggerating when I say that almost everyone has heard about The Passage by Justin Cronin by now. At least the people in the booking world have." The only explanation I have now, having read the book, is that the reviewer is a bookie and they have some sick sense of choosing what they read. Ok, I am a little mean. Truth is that other people that I respect have blogged about the book and recommended it; I just can't fathom why.

Partly to blame is the writing style. Justin Cronin needs to make you understand what everyone is feeling by describing the most mundane parts of their lives and what they experienced. It's not the good type of description, where you get to know the people because of their thoughts and actions, it's just a lot of internal monologues on subjects I couldn't care less about. I feel that a good book is the one that contains mostly ideas relevant to the subject of the book and most of what these people thought or did was not. I am not very good with other people's feelings, so I thought it was all me and I continued to read through the book as a virus from South America that made people into blood thirsty immortal creatures was brought in the US in order to study how it could be used to create weapons. Not the best plot device ever, but I was already forcing myself to suspend my disbelief. (Cronin, that was your job, not mine!) Naturally, the virus escapes containment, unleashing chaos and destruction on the face of the world. I was a third into this rather long book when all the characters so painstakingly described disappear. They all die. Fast forward almost a century later. Now you see my dilemma? How can that be good writing?

Anyway, now people are living inside a high walled colony (because vampires can't enter a makeshift colony defended by lights and crossbows, but they have defeated armoured vehicles and military bunkers) and believe themselves to be the last remains of humanity. All 100 of them. I have to, again, read all about the feelings of people and how they see themselves and the world. Here we get some chapters extracted from people's diaries that are presented at some future outbreak conference. So, halfway through the book, we know it will end well. In case I was starting to enjoy the story. There are some heroic characters around, they do heroic stuff, then, another third in the book, they leave the colony. About a dozen or so. They go through vampire infested territory, losing a few people and the opportunity to know how they felt about it, and find out some important information on how to defeat the vampires. They were not the only remnants of humanity, no, humanity was nice and well fighting the vampires in the most ridiculous and inefficient manner possible. So, after completely removing another 95% of all the characters we got to know uselessly, we have a Mad Max kind of ride to other people. Lucky for me, these other people were pretty much empty plot devices so I didn't get to know how they felt one way or the other. Blessed joy!

At this point I was barely containing my impatience for the book to end. Some sort of bloody resolution to the mess I had read until then. They kill a master-vampire, they get a powerful version of the virus that makes people hybrids and retain their memories, they use a nuke! Wonderful. Then some idiotic woman decides she knows what is best and makes a completely unilateral decision based on "humanity" which pretty much dooms them all and separates the main character from his love forever, but they all accept it as "what should be". Fuming with frustration, I speed it up in order to get to the end of the book, mere tens of pages coming. And it comes. With a little religious crap and a sort of lame cliffhanger and a complete stop. Guess what? It's a bloody saga! See the book cover, there is more coming!

So I am sorry, Axe! I am sorry, Wertzone! I hated the book. It was as pointless as it wasn't making any sense. Maybe the guy can write, but I couldn't notice it because of all the ridiculous premises of the book and all the feely descriptions. I will not read the rest, I will not recommend this book and, if for some strange reason OMG, everybody is talking about this book, tell them you read it here: read something else!

and has 0 comments

World of Ptavvs is a book first published in 1966, therefore it feels very dated indeed. Still, while reading the book, I've realised how I missed the style of the sci-fi back then, when the world was grand, the future was brilliant, people would all be intelligent and rational, doing what is smart and what is right, with a power of will that defined their very being. Remember Asimov? It's like that! And it's no wonder, both Larry Niven and Isaac Asimov were technical people at their core, even if they have expanded their interests in many other spheres as well. I have to reiterate this: in this time of Generation Me, when everything seems to be focused on the intensity of one's emotions, rather than on what the situation at hand is and what to do about it, when legions of film makers and young adult writers pound this insane idea that what we feel is more important than what we think and our own belief is more important than the welfare of the people around us, in these horrible times books like World of Ptavvs feel like good medicine.

Not the the book was not ridiculous in many aspects. The fusion drives, the trips towards Pluto that took a few days, a "belter" civilisation populating the main asteroid belt and moving around in ships that were essentially huge fusion bombs, the way people with terrible burns and psychic trauma would calmly talk about their ordeal to the scientific investigator come to solve the problem, the idealistic discussions that spawned out of nowhere in moments of maximum tension, the intelligent civilisation of dolphins that dream to go to space, the psionic powers... all of these were at the same time wonderful to behold and quite silly. However, I liked the book, I gobbled it up.

The plot is about this alien that can control the minds of others. Their entire civilisation is based on enslaving other populations via their Power. He is the victim of a malfunction in space and activates a retarder field that will protect him from time and space interactions until someone removes him from this stasis. Thus, he reaches Earth and remains on the bottom of the ocean for billions of years. When people get him out of his shell, all hell breaks loose, the book transforming into a space race and a philosophical introspection at the same time.

I can't make justice to the subject in a few words any more than I can do it in more words without spoiling the pleasure of the read - I've already said too much. If you feel you are in the mood for old school sci-fi, World of Ptavvs is a good book, reminiscent of the works of Asimov or van Vogt. Silly, yet grandiose at the same time.



I think that The Checklist Manifesto is a book that every technical professional should read. It is simple to read, to the point and extremely useful. I first heard about it in a Scrum training and now, after reading it, I think it was the best thing that came out of it (and it was a pretty awesome training session). What is this book about, then? It is about a surgeon that researches the way a simple checklist can improve the daily routine in a multitude of domains, but mainly, of course, in surgery. And the results are astounding: a two fold reduction in operating room accidents and/or postoperatory infections and complications. Atul Gawande does not stop there, though, he uses examples from other fields to bring his point around, focusing a lot on the one that introduced the wide spread use of checklists: aviation.

There is a lot to learn from this book. I couldn't help always comparing what the author had to say about surgery with the job I am doing, software development, and with the Scrum system we are currently employing. I think that, given he would have heard of Scrum and the industrial management processes it evolved from, Gawande would have surely talked about it in the book. There is no technical field that could not benefit from this, including things like playing chess or one's daily routine. The main idea of the book is that checklists take care of the simple, dumb things that we have to do, in order to unclutter our brain for the complex and intuitive work. It enables self discipline and allows for unexpected increases in efficiency. I am certainly considering using in my own life some of the knowledge I gained, and not only at the workplace.

What I could skim from the book, things that I marked as worthy to remember:
  • Do not punish mistakes, instead give more chances to experience and learning - this is paramount to any analytical process. The purpose is not to kill the host, but to help it adapt to the disease. Own your mistakes, analyse them, learn from them.
  • Decentralize control - let professionals assume responsibility and handle their own jobs as they know best. Dictating every action from the top puts enormous pressure on few people that cannot possibly know everything and react with enough speed to the unpredictable
  • Communication is paramount in managing complex and unexpected situations, while things like checklists can take care of simple and necessary things - this is the main idea of the book, enabling creativity and intuition by checking off the routine stuff
  • A process can help by only changing behaviour - Gawande gives an example where soap was freely given to people, together with instructions on how and when to use it. It had significant beneficial effects on people, not because of the soap per sé, but because it changed behaviour. They were already buying and using soap, but the routine and discipline of soap use was the most important result
  • Team huddles - like in some American sports, when a team is trying to achieve a result, they need to communicate well. One of the important checks for all the lists in the book was a discussion between all team members describing what they are about to do. Equally important is communicating during the task, but also at the end, where conclusions can be drawn and outcomes discussed
  • Checklists can be bad - a good checklist is precise, to the point, easy to use. A long and verbose list can impede people from their task, rather than help them, while vague items in the lists cause more harm than good
  • A very important part of using a checklist system is to clearly define pause points - they are the moments at which people take the list and check things from it. An undefined or vaguely defined pause point is just as bad as useless checklist items
  • Checklists are of two flavours - READ-DO, like a food recipe, with clear actions that must be performed in order, and DO-CONFIRM, where people stop to see what was accomplished and what is left to do, like a shopping list
  • A good checklist should optimally have between five and nine items - the number of items the human brain can easily remember. This is not a strong rule, but it does help
  • Investigate failures - there is no other way to adapt
  • A checklist gotcha is the translation - people might make an effort to make a checklist do wonders in a certain context, only to find that translating it to other cultures is very difficult and prone to errors. A checklist is itself subject to failure investigation and adaptation
  • Lobbying and greed are hurting us - a particularly emotional bit of the book is a small rant in which the author describes how people would have jumped on a pill or an expensive surgical device that would have brought the same great results as checklists, only to observe that people are less interested in something easy to copy, distribute and that doesn't bring benefits to anyone except the patients. That was a painful lesson
  • The star test pilot is dead - there was a time when crazy brave test pilots would risk their lives to test airplanes. The checklist method has removed the need for unnecessary risks and slowly removed the danger and complexity in the test pilot work, thus destroying the mythos. That also reduced the number of useless deaths significantly.
  • The financial investors that behave most like airline captains are the most successful - they balance their own greed or need for excitement with carefully crafted checklists, enabling their "guts" with the certainty that small details were not missed or ignored for reasons of wishful thinking
  • The Hudson river hero(es) - an interesting point was made when describing the Hudson river airplane crash. Even if the crew worked perfectly with each other, keeping their calm in the face of both engines suddenly stopping, calming and preparing the passengers, carefully checking things off their lists and completing each other's tasks, the media pulled hard to make only the pilot a hero. Surely he denied it every time and said that it was a crew effort because he was modest. Clearly he had everything under control. That did not happen and it also explains why the checklist is so effective and yet so few people actually employ it. We dream of something else
  • We are not built for discipline - that is why discipline is something that enables itself. It takes a little discipline to become more disciplined. A checklist ensures a kind of formal discipline in cases previously analysed by yourself. It assumes control over the emotional need for risk and excitement.
  • Optimize the system, not the parts - it is always the best choice to look at something as a whole and improve it as a whole. The author mentions an experiment of building a car from the best parts, taken from different companies. The result was a junk car that was not very good. The way the parts interact with one another is often more important than individual performance

I am ending this review with the two YouTube videos on how to use and how not to use the WHO Surgical Safety Checklist that Atul Gawande created for surgical team all around the globe.



It was long overdue for me to read a technical book and I've decided to go for a classic from 1999 about refactoring, written by software development icons as Martin Fowler and Kent Beck. As such, it is not a surprise that Refactoring: Improving the Design of Existing Code feels a little dated. However, not as much as I had expected. You see, the book is trying to familiarize the user with the idea of refactoring, something programmers of these days don't need. In 1999, though, that was a breakthrough concept and it needed not only explained, but lobbied. At the same time, the issues they describe regarding the process of refactoring, starting from the mechanics to the obstacles, feel as recent as today. Who didn't try to convince their managers to allow them a bit of refactoring time in order to improve the quality and readability of code, only to be met with the always pleasant "And what improvement would the client see?" or "are there ANY risks involved?" ?

The refactoring book starts by explaining what refactoring means, from the noun, which means the individual move, like Extract Method, to the verb, which represents the process of improving the readability and quality of the code base without changing functionality. To the defense of the managerial point of view, somewhere at the end of the book, authors submit that big refactoring cycles are usually a recipe for disaster, instead preaching for small, testable refactorings on the areas you are working on: clean the code before you add functionality. Refactoring is also promoting software testing. One cannot be confident they did not introduce bugs when they refactor if the functionality is not covered by automated or at least manual tests. One of the most important tenets of the book is that you write code for other programmers (or for yourself), not for the computer. Development speed comes from quickly grasping the intention and implementation when reading, maintaining and changing a bit of code. Refactoring is the process that improves the readability of code. Machines go faster no matter how you write the code, as long as it works.

The book is first describing and advocating refactoring, then presenting the various refactoring moves, in a sort of structured way, akin to the software patterns that Martin Fowler also attempted to catalog, then having a few chapter written by the other authors, with their own view of things. It can be used as a reference, I guess, even if Fowler's site does a better job at that. Also, it is an interesting read, even if, overall, it felt to me like a rehearsal of my own ideas on the subject. Many of the refactorings in the catalog are now automated in IDEs, but the more complex ones have not only the mechanics explained, but the reasons for why they should be used and where. That structured way of describing them might feel like repeating the obvious, but I bet if asked you couldn't come up with a conscious description of the place a specific refactoring should be used. Also, while reading those specific bits, I kept fantasizing about an automated tool that could suggest refactorings, maybe using FxCop or something like that.

Things I've marked down from the book, in the order I wrote them down in:
  • Refactoring versus Optimization - Optimizing the performance or improving some functionality should not be mixed up with the refactoring of code, which aims to improve readability of code while preserving the initial functionality. Mixing them up is pitting the two essential stages of development one against the other.
  • Methods should use their data of their own object - one of the telltales of need to refactor is when methods from an object use data from another object. It smells like the method should be moved in the responsibility of that other object.
  • When it is easy to refactor, choose a simple design - Of course the opposite is true, as well: when you know it will be hard to refactor a piece of code, try to design it first. If not, it is better to not add unnecessary complexity. This is in line with the KISS concept.
  • Split your application into self encapsulated parts - One of the ways to simplify refactoring is to separate your application into bits that you can manage separately. If you didn't design your application like that, try to first split it, then refactor.
  • Whenever you need to write a comment, consider extracting a method with a meaningful name - or renaming methods to be more expressive.
  • Consider polymorphism when seeing a switch statement - Now that is an interesting topic in itself. Why would polymorphism help here? How could it be simpler to understand than a switch/case statement? The idea behind this is that if you have a switch somewhere, you might have it somewhere else as well. Instead of taking decisions inside each method, it is better to split that behaviour in separate classes, each describing the particular value that the switch would have operated on.
  • Test before refactoring - this would have been drilled in your head already, but if not, the book will do that to you. In order to not add faults to the program with the refactoring, make sure you have tests for the existing functionality, tests that should pass after the refactoring process, as well.
  • The Quantity pattern - Review the Quantity pattern in order to improve readability and encapsulate simple common actions performed on specific types of units.
  • Split conditionals into methods - in other words try to simplify your conditional blocks to if conditionMethod() then ifMethod() else elseMethod(). It might seem a sure way to get to a fragmented code base, with small methods everywhere, but the idea is sound. A condition, after all, is an intention. Encapsulate it into a well named method and it will be very clear what the programmer intended. Maybe the same method will be used in other places as well, and then, using polymorphism, one can get rid of the conditional altogether.
  • Use Null objects - an interesting concept that I haven't even considered before. It is easy to recognize the need for a Null object when there are a lot of checks for null. if x==null then something() else x.somethingElse() would be turned into a simple x.something() if instead of null, x would be an object that represents empty, but still has attached behavior. An interesting side effect of this is that often the Null object can be made an immutable singleton.
  • Code inside Assertions always executes - This is a gotcha I found interesting. Imagine the following code: Assert.IsTrue(SomeCondition()) Even if the Assert object is designed to not execute anything in Release mode, only compiled in Debug, the method SomeCondition() will execute all the time. One option is to use an extra condition: Assert.IsTrue(Assert.On&&SomeCondition()) or, in C#, try to send an expression: Assert.IsTrue(()=>SomeCondition())
  • Careful when replacing method parameters with parameter object in parallel processing scenarios - Which nowadays means always. Anyways, the idea is that old libraries designed for parallel processing used large value parameter lists. One might be inclined to Introduce Parameter Object, but that introduces a reference object that might lead to locking issues. Just another gotcha.
  • Separate Modifier from Query - This is a useful convention to remember. A method should either get some information (query) or change some data (modifier), not both. It makes the intention clear.

That's about it. I have wet dreams of cleaning up the code base I am working on right now, maybe in a pair programming way (also a suggestion in the book and a situation when pair programming really seems a great opportunity), but I don't have the time. Maybe this summary of the book will inspire others who have it.

and has 0 comments
This is the second book by William Golding that I am reading. Unbeknownst to me, it is part of a trilogy! Even Nobel prize winners for Literature seem to can't help but write the damn things. How is one to finish reading all they want to read?! Anyway, the guy wrote Lord of the Flies, reason for the Nobel and a story I enjoyed both as book and movie. Rites of Passage has many similarities with that book. It happens at sea, on a ship, not on an island, but just as removed from the normal rules of civilised society. It reveals dark depths of human morality. It exposes hypocrisy and narrow mindedness. Golding also won an award for it, the Booker prize this time.

So, what is it about? There is this nobleman, godson of an unidentified but very important man, travelling on a ship from England to "the Antipodes" where he is to take an important state office. The guy is the highest socially elevated person on the ship, giving him some sort of equal footing with the captain himself, who is normally king and church on his ship. Now, the book appears as the journal of said guy, of the name of Talbot, written to his godfather, as a means to thank and humour the man, restricted in his own life by the gout disease. That is where the book is at its most difficult: the language is that of an Englishman noble from the 19th century, with antiquated words and funny ways of turning them into sentences. I pride myself on having understood and finished it, but now, that I know it is part of a trilogy, I am a bit disconcerted.

Anyway, the journal of Talbot presents us with the marvellous world of a ship at sea, forcing the reader to both empathise with the man, but also share some of his opinions of the lower castes and of the social system. We get to share his view of the current events as well. He thinks of himself as noble, intellectually and morally superior to other people on the ship, while exercising a benevolent and understanding indulgence at the actions of others. He truly seems to be the most intellectual person on board, as educated in comparison with others as a college graduate is to a four grade drop out. However, he is a bit of a dick, full of condescension and of the weaknesses of all men.

The main moral of the story is that his arrogant views on the world of the ship are reasonable, if taking as true the presuppositions he makes as member of his social class and having his position on the ship. However, they are completely wrong as related to what really happened. We understand this in the second half of the book, where he relates the contents of another man's journal, who's perspectives on the situations turn our perceptions on their head. Also, the finale is quite grotesque, revealing that his blindness to the world around him is, more or less, voluntary and part of the social system he represents.

This is a difficult book to read, but one that opens eyes, so to speak. Not only we get to see how English was meant to be used (bah, Americans! :) ) but also the author is taking us through the recesses of the human mind and society and the experience of the read is a visceral and personal one. If you can handle the language and the slow pace, I recommend reading this book.

There is also a quicker option for the ones who want to see what happens without having to read the books. The To the Ends of the Earth trilogy has been adapted to a miniseries, by the BBC, of course, starring Benedict Cumberbatch.

and has 1 comment
Towers of Midnight, the 13th book in the Wheel of Time series and the book before last in the saga, was a great read. As the second volume written by Brandon Sanderson after Robert Jordan's death, it benefited a lot from Sanderson's fluid writing style and the fact that all the stories are coming to their end.

The plot was interesting, too, with all three ta'veren characters doing their part, all the girls (except Nynaeve!) being involved and quite a few Forsaken as well, with interesting gimmicks the Darkfriend previously known as Luc and even a gholam!. The entire Trakand clan is represented and there are blessedly few Aiel. In this book Moiraine is found, there is some news of lovely and terrible Lanfear and someone dies (although, of course, nobody important and they die quite uselessly) while battling Aelfinn and Eelfinn, while The Final Battle approaches, with the revelation of red veilled dark Aiel?

My feeling of the book was one of discovery. Brandon Sanderson is writing this book with the enthusiasm of someone that just started work on a story (because he did!), yet with all the legacy material from Robert Jordan to build upon. No wonder the last part of the series was supposed to be just one book and resulted in three at the end. That means the story feels fresh, even if I have been reading it for the last four months. Also, it is no surprise that Sanderson could not maintain the fearful and deferential view of women that Jordan cultivated in the previous books. Oh, don't worry, they continue to meddle in all the affairs of others and their behaviour is just as erratic and irrational as before, it's just that men don't act like cowed idiots anymore and actually have a backbone. I don't know if this was supposed to happen in the original author's view, but I am willing to bet that it was not. Actually, this is one of the worse points of the story, when Elayne (the queen of Andor), Egwene (the Amyrlin seat) and Faille (Perrin's wife and princess of Saldaea) are plotting and acting like they own the world, while at the same time putting themselves in all sorts of dangers where they have to be saved by others. Of course, the others more often end up dead, but there is always some handy rationalization for behaving like an idiot. Amazingly enough, though, Cadsuane and even Moiraine are behaving quite well. The End must really be coming!

The bottom line is that I have finished reading the series. The last book won't be published until 2013, so now I am free to read other books. Yatta! I've gathered a technical book about refactoring, The Rites of Passage, by William Golding, and The Checklist Manifesto, which I hear is both instructive and interesting to read (not to mention short). So, I guess the wheel won't be turning as the wheel wants until next year. Meanwhile, you're stuck with me!