Tuesday, June 20, 2017

Children of Earth and Sky, by Guy Gavriel Kay

book cover The only fantastical element in this book, except for a ghost that makes a short appearance, is a change in location. The rest is historical fiction in some place that feels exactly like Renaissance Europe, only it has another name and other gods. Worst than that, the story is boring and the writing mediocre. I couldn't finish it.

The story in Children of Earth and Sky follows a few chosen characters while they navigate the treacherous waters lying between warring (and spying) nations. I mean this both metaphorically and literally, since it is also about ships crossing the sea. Guy Gavriel Kay has been writing published works since 1984 which is why I was surprised to see such an amateurish writing style. He uses several tools again and again and again, without much effect. The worse, for me, was describing the same scene from different viewpoints, one after another, even if it did nothing to enrich the story or develop characters. Another is a certain repetition of a phrase for emphasis, something like "He didn't like the book. He didn't." OK, emphasized enough! Also I felt that the author coddled his characters too much. Instead of making them suffer in interesting situations, he just lets them off easy with crises that they can easily handle or at least manage with heroic skill. In one of the most important scenes, one of a battle, he kills off a major character, at which point I was thinking "OK, it's getting started", only to resurrect them immediately after. Ugh!

So beside being a boring historical drama (I mean boring even for a historical drama!), it really nagged me that it was marketed as fantasy. Maybe I am just getting fed up, considering I've just read a western and a heist story, both included in the fantasy and sci-fi genre because they happened in the future or in spaaaaaace. Bottom line: I can't in good conscience recommend this book and I am quite amazed that it has such a high rating.

Sunday, June 18, 2017

Realm of the Damned, an improbably entertaining animated motion comic

At first I thought Realm of the Damned would be boring. It was a series of comic book images animated via moving them around or deforming them, while a narrator was speaking on the background. The story also had the seeds that have been used so many times with little success: Van Helsing, vampires, werewolves and so on. But it was only one hour long, how bad could it be? And as the story progressed I really enjoyed the experience. And it wasn't because of the gory graphics or the strong voices or the heavy metal music as much as it was the story. Surprisingly deep, it explores not only a world that is dominated by undead monsters, but the inner turmoils of the last defender of humanity. The ending was gripping and terrible and funny at the same time.

I recommend it highly. Here is the trailer:

Monday, June 12, 2017

Three (Legends of the Duskwalker #1), by Jay Posey

book cover Three is a western. The fact that it happens in a post apocalyptic cyberpunk world is incidental. Jay Posey writes about the classical strong silent reluctant hero who fights for a good cause represented by a woman who has changed her ways and her innocent child. There are cyber zombies, there are evil pursuers and a world in which the strong survive in strongholds that are few and far between.

The book works because the writing is good and because the author never attempts to explain what happened to the world or how things actually work. It could have just as well been magic and pixie dust and the story would have remained basically unchanged. And unlike what the title of the review might indicate, you can read the book as a stand alone story, even if it has sequels. It had a beginning, a middle and a resolution.

Bottom line: an enjoyable book, albeit a bit predictable. Its strong suit is the good writing rather than a particularly smart idea or world building or even subtle characterization. Characters are kind of cardboard, but their actions and what happens around them is all well written. I don't think I will continue to read the series, but the author intrigues me and so I may read other books of his, like the new Outriders.

Saturday, June 10, 2017

The Cool People

cool people next to the water cooler Cool people are those who respond to your opinions with condescension. Anything different from what they believe is ridiculous, pathetic, laughable or dangerous. I mean, they could even be right: you might have said something really stupid. But while you can handle finding out that something you were thinking is not true, they cannot. Their whole world view is based on them being right. While you might see them as a little hurtful and a bit annoying, they see you as a threat, because their truth is something they desperately cling to and any type of difference challenges their way of life.

You will usually meet them in positions of power. They are not enough of a sociopath to be top leadership, but they will be somewhere in the middle, telling themselves the story of how in control of their life they are. They clump together, because a tale is easier to believe in a group than by yourself. They drink together, they watch the same sports, they play the same games, they go in the same vacations, they have the same gods and the same rituals. Their information bubbles existed way before Facebook and while you might see them as ridiculous bubble people, they always fear you are carrying a pin to burst theirs. Cool people always know "how the world works" and to pretend otherwise would only mean you are not as savvy. Major changes leave them helpless and in search of a narrative that explains that away from their view of the world. Beware a former cool person for they are desperate.

They will applaud each other vigorously at every little success as they feel it's a validation of their own. Unfortunately, that means they will stand in the way of your success, as they feel it invalidates theirs. Cool people live on a narrow ladder, where everybody is clearly ranked on a vertical scale. Not being on their ladder makes them feel superior to you. Not wanting to be on their ladder makes them feel threatened by you. While you are exchanging information you possess, they only coerce it out of you in order to judge and rank you on their scale. When they are exchanging information is from a feeling of generosity, allowing you to know where the cool is; not being grateful angers them.

Cool people keep in touch. They cannot allow coolness to exist in different flavors. They maintain contact in order to synchronize their shared concepts. Socially it is easy for two cool people to communicate, because they are very similar. It is important to make other people feel not cool enough, because a cool person can't handle a conversation that doesn't follow a familiar pattern. While the problem is mostly theirs, they need to shift the blame onto others. They smile easily as a well trained skill, not an expression of how they feel. Smiles and laughter are tools and weapons for them.

Uncool people are essential to the well being of cool people. A careful dance of keeping people just far enough to indicate superiority, but close enough to make it visible to any outside observer, is essential to the lifestyle of cool people. While you either despise, pity or envy them, but you could easily do without them, they actually need you.

So how cool are you? I am not cool. I am better than cool. Me and my kind.

Friday, June 09, 2017

Roses and Rot, by Kat Howard

book cover This reminded me of The Call, by Peadar Ó Guilín, another very well received book I've recently read. It features a female perspective, fairies and an unapologetic dissection of the human soul. The Call is better, but still, this is a very interesting book I will also recommend reading.

In Roses and Rot, Kat Howard uses the world of the Fae as an excuse to examine the bonds between people, the toxic effects of self-centeredness, whether in a parent or in yourself as you try to achieve some of your goals at the expense of others, and how people have to sacrifice for what they love. Imagine a magical place where everything is offered to you on a silver platter, with the promise that the best of you will get... a golden platter or whatever. And there is always a price.

I liked the psychological aspects of the story. There isn't much else of it, actually. As I said, the magic is merely incidental as the book is about the struggles of artists and daughters of idiots. I would go as far as not calling it fantasy at all. I disliked the close similarity between Janet and the girls' mother - I won't expand on this for fear of spoiling it. Enough to say that Helena's character and sidestory felt like a training run for what could have happened to the protagonist if not for her sister, so in one fell swoop, two characters from the already short list of relevant ones are just shadow copies of others. Add to this a lot of other details that are customized for the lead and you start to suspect this is a very autobiographical story. I don't know Kat Howard so well as to say it was, though. I will quote from the book though: “These [fairy tales] will be more autobiographical in nature than the Grimms'.”

Bottom line: It was a heartfelt story and I liked it. It is also short and not part of a billionogy, so you can just read it and enjoy it. Less fantasy than psychological drama, though.

Wednesday, June 07, 2017

Dark Run (Keiko #1), by Mike Brooks

book cover Dark Run is a classic pulp space mercenary book. It isn't even sci-fi at its core. It could have just as well been a western, a pirates or a heist book, as the science and technology don't further the story in any meaningful way.

I don't have anything specific to say about the book. Mike Brooks uses an overused plot of a specialized team of renegades being double crossed and having to defend their honor and punish the responsible. The characters are pure cardboard, with no subtlety, and even the humor is weak. I mean, it's pulp fiction, the author did a decent job writing one. As literature, though, it's not something I could possibly recommend.

The Summer Dragon (The Evertide #1), by Todd Lockwood

book cover Sagas and trilogies be damned! The Summer Dragon was a really entertaining book and having it end as a mere episode in a larger story that hasn't been written yet is quite frustrating.

Todd Lockwood is mostly known for his fantasy illustrations, not writing, and Summer Dragon is his debut novel. It is an YA story, with a similar structure as so many others: young nobody discovers they have special abilities and are thrown in a world of mystery, wonder and danger, with adults being either weak supporting characters and/or villains, but done right! The heroine - yes, a girl - is thrown into a situation in which politics and culture are forcing her to either be completely passive and submissive or to take action by herself. She doesn't do it with superpowers, but with the knowledge she learned from her father and her own personal courage and ingenuity. In the end she does overcome some pretty insurmountable odds, but it never gets too annoying. If there is a flaw I have to talk about it is the fact that each chapter is written with the same hero's journey structure, with new tension added at the end and character building in the middle. The author is a bit too neat in following the writing guidelines.

I liked that the protagonist is a woman. This is, so far, a perfect feminist book, since she is fighting real issues, social, political and military, using her own skills and in the few situations where she is a love interest she doesn't automatically feel she needs to either reciprocate or condescend and insult her suitor. It is also a book about dragons, but she is the daughter of a dragon breeder, rather than a kid that suddenly discovers there are dragons or other crap like that. The world is not very detailed, but what is in the book is pretty consistent and has a lot of potential.

I don't want to spoil the book by giving details, but there was also something that I felt was a missed opportunity. In an already existing conflict a third party emerges, a super villain, if you will. It was the perfect moment to switch the real source of the "evil" and to reframe an existing war as something that no one participating really understood. As written, it is very difficult to understand why career military men locked in a prolonged conflict dismiss vital tactical and strategic information for silly things like religious fervor or personal greed.

Given the opportunity I would have immediately read the other books in the series. Alas, The Summer Dragon was released just last year and it's the only published book so far. If you want to avoid frustration, wait until Lockwood writes a few more books and then start reading the series. I have great hopes for it.

Jack Glass, by Adam Roberts

book cover There is a cover for the book that writes "Best SF Novel of the Year BSFA Award". I can only assert that it was either competing alone, that they give a prize to all contestants or that the British SF Association doesn't know what a good book is. Its worst flaw is that it is naive. First with its depiction of space. Stuff in the book would not have worked in the 80s, I believe, much less in 2012 when the book was released. The style of the prose seems to emulate works from the 50s and 60s and at first I wondered if it wasn't intentional, like a sort of parody or tip of the hat. Regardless, the book remains naive in almost all aspects, even those of the basic plot, which is not sci-fi, but rather whodunnit and escape from the room stuff.

That being said, Jack Glass is not a totally bad book, either. It presented some ideas that were rather fresh. Using convicts to prepare asteroids for colonization, for example, or having trillions of people living in the Solar System, not on planets, but asteroids and such, the idea that each of these habitats would create their own flavor of religion and culture. But other than these rare juicy details, the rest of the book is quite boring, predictable and bad. The clues to solve the mysteries, rather than being presented to the reader so that they can participate in the solving, are brought in by random plot events, like dreams. People that were supposed to be the best rationalists, Sherlock Holmes style, were being manipulated and educated by ordinary people that somehow knew and understood more. The laws of physics, psychology and sociology are being completely ignored.

Bottom line, a bad book from Adam Roberts, with the occasional hidden gem that doesn't really save the silly plot and ugly narrative.

The case of the bitch and her mysterious disease

So, me and the wife were walking our dog in the park one Saturday evening when we saw this female German Sheppard mutt looking all lost and terrified. The wife, being the heart of us two, points out to me that the dog is probably lost and she looks terrified. Me, not being the heart in the relationship, just hoped her owners would show up. Well, one can't ignore one's heart, as my wife keeps repeating in the hope I am listening, so I end up attaching a leash to the dog's collar and heroically attempting to save the dog.

The plan was as follows. Step 1: take the dog to the vet. Step 2: the vet will know what to do. Additional info: the dog was walking really strange, was terrified of everything, but especially crossing streets and was bleeding from between the legs, occasionally appearing to try to piss and nothing coming out. Suspecting a car hit and maybe internal bleeding, I rushed the dog to the vet I know in the area, who also treats my dog. Imagine doing that with a 20 kilos dog who is afraid of streets, basically.

Step 1 went to shit when I realized the vet was closed at that hour on Saturday. I mean, nothing ever happens to dogs in the weekend, right? I tried calling pet ambulances, they all refused to come, claiming not enough capacity. Finally I called the wife to come with the car and drive us to a nearby non stop veterinarian clinic.

The situation looked like this: female dog in heat (not internal bleeding) which was probably not hit by a car, but walks funny because she is probably not right in the head, first suspected to be 5 to 7 years old, but then age adjusted to over 8, erratically aggressive (although what aggressive meant to the doctor seemed to be a low growl of annoyance). Also, the doctor didn't know any shelters, groups that take care of lost dogs or anything like that. Surely no dogs get lost and found and then brought to vets. He had no idea what to do. So Step 2 went to shit when the vet told us the dog was not microchipped, was probably abandoned and, for all intents and purposes, was now ours, since no one adopts old dogs.

We decided to pay for some tests to figure out what is wrong with the dog and to keep her in the clinic, since she's a big unpredictable female dog in heat and our dog is male. We did that daily, paying a lot of money for it, until around Tuesday, when the doctors decided that the dog problems were probably neurological and that her uterus was malformed and probably would have caused the dog to die in the near future unless operated and removed. I was about to authorize the operation, too, and was thinking of names for the dog. Since our dog is named Tyrion, naturally she would have been Arya, but for the fact the dog was older, so maybe Sansa - she was traumatized and afraid of everything, too. In the end I was going for Lysa - since that was the older crazy aunt in Games of Thrones.

And here comes serendipity. A young woman comes to the clinic and asks if it is possible for dogs to run away from home in order to die. Apparently, her dog, staying with her parents, ran away from home and said parents were too horrified to tell her of that until that day. Stranger still, in the rare occasions that the dog was getting lost, she always returned home, which she now failed to do. No, the girl didn't look for found dog ads (which I posted all over the Internet), she didn't ask around in the park where the dog was lost (where I told just about every dog owner to spread the word), no, she just randomly arrived at the same clinic and asked this question. Of course, it was her dog we were talking about. No, lady, when dogs run away from home they usually go to the vet to get checked out!

So, if and when the dog will get operated or receive specialized treatment for her brain issues - which apparently she had since she was a pup - is the owner's business, and we only offered our financial aid in case it was needed. Happy ending, the dog is back with her owners, with some extra medical tests done and possible solutions for her future well being on the table.

Saturday, May 27, 2017

Samurai Jack is dead!

16 years ago, Samurai Jack premiered as an animated show where a honorable samurai travels through time to destroy the demon Aku, who has taken over the world and made it evil. With Genndy Tartakovsky's genius behind it, this tale of good versus evil never seemed too simple or too idealistic, something movies today and in the future need to learn. However, after only four seasons, the show was not renewed, leaving fans with the bitter sweet conclusion that evil will triumph if no one fights against it, especially in the world of movies and series.

And people fought and the series received its continuation... and its ending, a season 5 that ends in a glorious finale. What comes next is a spoiler for the last season and the show's finale, you've been warned.

Click to show spoiler

For Entertainment Weekly, Геннадий had this to say: This is it. This is the definitive end, and it’s a great end. I haven’t seen it yet, but I’ve storyboarded it, and I think it’s super satisfying, and it should close the door for me for Samurai Jack. … Now, look, there’s 50 years between season 4 and season 5, and if somebody wanted to jump in and do some stories in between, but for me this is the end

Anyway, I really hope Tartakovsky comes with something new soon, something that is just as creative and just as actual as Samurai Jack was. He somehow made a show about a samurai feel futuristic. That's not easy. And even his most childish shows, like The Powerpuff Girls, were great. He will be directing Hotel Transylvania 3 next, but I really wish he wouldn't burn out and stick to movies, especially stupid ones like this, when his shows were the highlights of my youth.

Thursday, May 25, 2017

Cold Magic (SpiritWalker #1), by Kate Elliott

book cover Just look at that book cover. Someone was already imagining the multiple Hollywood movies, or at least a TV series. Yes, it's another young adult story, but this one is different because it is from the point of view of a girl. Besides, I've read several YA books and I liked some of them.

In Cold Magic, Kate Elliott describes a feudal world in which the rulers are either princes or "cold" mages, although there are many other aspects of magic in the world that are briefly explored. There is a lot of history, too, parallel to the European one - if magic was real in the Napoleonic times. For the first quarter of the book I lapped it up. I was curious to see how this young girl manages to untangle the mystery of the things that are happening to her and if she will thwart the powerful people who want to use her and her girl cousin. However, after a few chapters in which kind of the same thing happens over and over again, with no real reason, I was getting restless. Add to this the long descriptions of personal fashion, grooming and judgement on how people look and what it tells about them and I was starting to get a little annoyed. When it all turned to romance, I was simply disappointed. It wasn't that the point of view of the young woman ruined the story, but that it irritated me enough to make me attentive to the plot holes.

Bottom line: I am half curios on how the world building will evolve and how the author is going to describe this alternate magical Europe, but on the other hand I feel like the entire book I waited for something to happen and to make sense, when in fact all characters did things in order to move the story in a certain direction. Instead of being character driven, the plot meanders and the characters drift on it like leaves on a river. I can't empathize with people that lack almost any kind of control over what happens to them, especially since the trope of the young person thrown into a maelstrom of unexplained situations with people that speak in riddles and keep things for themselves is so overused in YA novels and I am tired of it. I will not read the next books in the Spiritwalker series. It was fun for the first half of the story, but then it went downhill.

Sunday, May 21, 2017

Zero Days (2016), a very interesting and well done documentary about Stuxnet

Here is my IMDb review for the film: A gold standard in documentary films and a very interesting story
Once you go beyond the automatic dislike of computer screen hexadecimals turning into beautiful 3D animations, which is the norm in all popularizing documentaries, you can see not only how interesting the story is and how well the film is done, but how much effort came into the gathering of the information in it.

This two hour film describes how Stuxnet changed the world, first from the eyes of malware researchers and how they discovered the worm and how they started to analyse it and realize how advanced it is and what it does, then goes into the political realm, describing how the US and Israel did this to Iran, then narrows down, showing not only how this was something the US did to prevent the Israelis to do even worse things, but how Stuxnet came back to bite its creators in the ass. In the end we are shown the true reality of a world in which anyone can do horrible damage with no attribution while the security institutions keep everything secret and out of public discussion and decision.

A very informative movie, filled with useful tidbits, showing the story of Stuxnet from start to end and to later consequences, interesting to both technical people and laymen alike. Well done!


I particularly liked the idea that the more aggressive the worm got, the less effective it was. Israelis pushed and pushed the US until the malware became more autonomous and the whole operation blew wide open and the Stuxnet worm infected American computers. It was funny to see how scared American agencies were about this new sophisticated malware attacking their systems, while other American agencies, the ones that created it, were prohibited by secrecy to reveal it was them.

I also found really interesting the fact that the most effective versions of the worm were subtle pieces of code that attacked very specific targets and needed a human operative to insert them into the system. The "public" version of Stuxnet, the one that became so visible antivirus people noticed it, that is the version that used stolen certificates and four zero-days exploits, but wasn't the one that actually delayed the Iranian nuclear operations for a year with no one the wiser about what was causing the damage. Blunt tinkering in the elegant code of the initial software led to its discovery and, indirectly, the creation of cyber warfare units in all national intelligence agencies.

Wednesday, May 17, 2017

Sleeping Giants (Themis Files #1), by Sylvain Neuvel

book image Gotta learn to not blindly trust book reviews that appear in my favorite web sites. I mean, they have the right to be wrong (aka to their own opinion). To be honest, I just expected the book to be better, I wasn't particularly upset with it. The review called it "the next Martian"; it's not even close. It's a completely different style, mood, idea and quality. But, that being said, I enjoyed it. Better still, I learned an interesting and probably valuable lesson out of it.

You see, Sleeping Giants is the closest I've come yet to a "hand held" book. The story is told exclusively through interviews and records of discussions. I mean, there is one scene where the heroes have to disarm some guards and instead of going quiet, they keep talking into their sat phone with someone so we can read what happened. It wasn't bad, but I sincerely hope that the rest of the books in the Themis Files series are not the same, although I am pretty sure I will not read them. However, I've learned from this. Even if you are shit at writing scenes, you can write a book that is being told through dialogue and short personal entries and tell the story.

So the story that Sylvain Neuvel tells is about us finding pieces of a giant alien robot and finding out how to operate it, even if the way it functions seems incomprehensible. I've covered the style, so now I have to tell you about the plot, which is naive to say the least, but enough to suspend your disbelief as you read the book. The beginning promises a lot more than the ending provides and, while I understand there is another book, I don't really care how the story ends.

Bottom line: a little fun sci-fantasy, with no real consequence or worth of mention. However, Sony did option the rights for the book, so who knows when we're going to get an alien robot defending the Earth against Godzilla movie, or whatever crap like that.

Sunday, May 14, 2017

Moved most Codeplex projects to Github

Microsoft is closing Codeplex, so I had to migrate all projects that I felt were still relevant to Github. First of all, you should know there is a migration tool at Codeplex to do this automatically. Second of all, you SHOULD NOT USE IT, because it's just stupid, plus it only works in cases where you committed source code, not archives of source code. It does't add a proper readme file or a licence file and it doesn't even migrate the description. So don't use it, just don't!

I don't know how I feel about this. I always wanted Codeplex to be successful, but with so little resources allocated for the project, I think it is better that they are closing it. It was a slow, out of date web site and Github is clearly better for many reasons. However I don't see how a monopoly on online source control is good either. Well...

Saturday, May 13, 2017

The Obelisk Gate (Broken Earth #2), by N. K. Jemisin

book cover The Obelisk Gate immediately follows the story from the first book in the Broken Earth series, The Fifth Season. N.K. Jemisin now makes clear which are the sides in the conflict and, with the characters thoroughly fleshed out in the previous book, she is free to let things happen, to finally feel there is a story, and a root cause and a purpose and some action. That is why, in many regards, even if it is just another part of the same story, The Obelisk Gate is the better book.

Unfortunately for me, I won't be able to read the third book, The Stone Sky, until it is released and then... err.. made available, which happens sometimes in August of this year. Yet at the same time I have to say that there was enough in this book to appease my desire for more Broken Earth. I may even not read the third book, even if I am curious on how it will all end. It is an important lesson to learn, that stories can burn themselves out before their time, just like an orrogene using too much power and dying of it. Somehow, at the end of Obelisk Gate there is not enough mystery left but what was so bluntly left out by the author with all the silent and "I'll tell you just enough" type of characters she used. I have to wonder if there is even enough material for a third book. The fact that there is a 2014 short story that seems to happen long after the third book makes me think that it was always planned as a trilogy and this will probably be it.

Bottom line: The sides become clearer, characters align with them and a lot of the education of normal people is being discarded in favor of the brutal way of thinking in case of terrible cataclysm and dire need. There is still a climax to come, but what will it entail except the obvious outcome and some fighting? To me, the important part of the story has been told already.

Friday, May 12, 2017

The Fifth Season (Broken Earth #1), by N. K. Jemisin

book cover The first book in the Broken Earth series, The Fifth Season is a good book. I liked the world building, the characters, even if there are so few of them and grabbing all the action in the story, and I am going to read the second book in the series, The Obelisk Gate, next.

The story is mostly a setup for the series, where the main characters are introduced and the world is built. As a far into the future post apocalyptic Earth, it is a mixture of old dead civilization influences and pure human survival. That is why some words that are particular to our culture stick out when used and N.K. Jemisin does slip a few in there, although not enough to be annoying. The book is split into three view points: the basically orphaned Damaya, the talented Syenite fast climbing in the ranks of the Fulcrum orrogenes and the old rogga Essun, walking a damaged landscape in order to find her husband... and kill him. The Essun point of view is written in second person, which may be off putting for a while, but one get used in time.

There isn't much else I can say without spoiling the story. The feeling at the end of the book is clearly not one of closure and catharsis, as it ends abruptly and you realize it is just the first part of a larger tale. While I can't say I was awed by the content or the writing style, they are both solid and professional. The book captivated me and I will be continuing to read the story, mostly to see where it goes.

Monday, May 08, 2017

The Night Ocean, by Paul la Farge

book cover It is tough reviewing a book like The Night Ocean because it is about so many things and at the same time about nothing much. Paul la Farge describes the experiences of a female psychotherapist who is married to a man obsessed by a book about the sex life of another writer (H.P.Lovecraft) so much that he follows leads, writes a book himself, based on the memories of a man who in the end turns out to be something different than anybody thought. So it's a book about a book about a book about books, basically, only written through the eyes of the people writing and being affected by said books.

Half of me screams in rage against the book, now that I have finished it, because it wanted some science fiction, some lovecraftian horror, some fanciful escape from reality. But the other half laughs, because no other book in recent memory is more about escape from reality and lovecraftian horror and even science fiction. Only not in the way I expected. It is so difficult to talk about the book because even minor details might spoil the experience. I can ruin your reading within a mere sentence, so I will try to talk about my personal feelings about the book, rather than its contents.

The writing is good. It is filled with details that pull you in into the places it describes. Sometimes it gets a little too much, I caught myself several times asking why is that detail there, what the hell does it have to do with the story. Well, let me guide you on how to read this book: there is no story. There is no cathartic ending that explains all. Instead the journey is the important part and instead of complaining about specifics, you should cherish them as you would a good meal. Since I am a fast eater, especially if the food is good, I can only advise you to do as I say, not as I did.

The subjects the book touches are many and La Farge spent a lot of time documenting them. It goes through homosexuality before and after the war, differences between Canadians and Americans, American paranoia against communism, the world of writers - science fiction in particular, but also various types of academics, German concentration camps, antisemitism in the U.S., history of the world and so on and so on. In a strange case of congruence, there is a scene in the book that is almost identical to one from a previously read book (Arkwright), with a science fiction convention in New York 1939, where a rebellious and revolutionary group of writers are not permitted to spread their particular views in the convention so they leave and form their own group.

Bottom line: while the subject itself felt unimportant and a bit boring, the writing and the world and character building kept me reading. It is not the type of book I usually read, but I can recognize a good book even if I don't particularly like it. And this is The Night Ocean for me, a great book about people that I should have not cared about, but the writer forced me to.

Sunday, April 23, 2017

The Next 100 Years: A Forecast for the 21st Century, by George Friedman

book cover This short but compact book is about all the stuff that I am really weak on: geography, history, politics and economics. Yeah, like everything remotely related to the real world. Yet I actually liked it a lot, especially the first half. In The Next 100 Years, George Friedman submits his thesis that geopolitics is what shapes history and that countries are pretty much locked in patterns that they cannot escape. Using this theory, he attempts to predict events in the twenty first century. While he starts with comparing historical expectations and predictions with reality twenty years later and finding they are completely different, the author concludes that some things factor too heavily in the long run to not predictably shape the direction of history.

What I liked about the book was how easily, cynically and depressingly he describes the underlying reasons for stuff that has happened, things that are published and marketed as triumphs of humanity or struggles of heroes and that, really, were quite unavoidable. An example is female emancipation. As having 8 children per family (which was the norm in the 19th century!) became unprofitable - as children were less needed as unskilled labor and getting them to school to give them skills was expensive - and as child mortality fell and as life expectancy grew, families started having fewer children. That meant a woman would not have to dedicate her life to breeding and raising children. With that much extra time, it became unavoidable that they would do something with it. Same root for changes in family structure, violent splits between conservatives and progressives and the contraction of religious power, which is trapped in defending unsustainable societal models, like keeping women as household administrators.

Same thing about the way countries react, why the U.S.A. became the global power that will shape this century and how the actions of the great actors in global politics, sometimes appearing as chaotic or insane, are very clear and even predictable once one determines the real goal behind those actions. As the leading global power, the United States of America doesn't need to win any wars, for example, just keep the other major players locked in situations of local crisis. Ending terrorism or bringing peace and stability all over the globe, while declared as the goals of international policy, are against American interests.

I was saying that I enjoyed the first half of the book more, because it was more theoretical and more broad. Some interesting predictions there, such as Turkey, Poland and Mexico becoming important actors in the political conflicts in this century. The second half goes into economics and becomes really American centric, using concepts that are only familiar to one that lives in that economy. Yet it describes some interesting dynamics, such as predicting that in the 2030s immigration will not only not be a problem anymore, but something leading nations will compete for, as working population decreases.

I can't possibly comment on the veracity of the book's predictions or on the validity of the author's methods, as I am a complete noob in any of the fields required to analyse this book. I can tell you that Friedman expected much more to have happened in the late 2010s than it actually happened. Also, I did a quick google search to look for opinions and I will detail them below. Yet first I will summarize the book as I see it.

Friedman asserts that the US will be the pivot around which all history will revolve in the twenty first century. It had the largest military force, it controls both oceans with its powerful navy, effectively dictating who can or cannot use it to transfer resources, and even if a heavy importer of resources, it had enough of its own. Moreover, its territory is unassailable by land. Other players will attempt to balance that power, such as the European Union, Russia, the Muslim nations or the South Asian nations, while the US will actively work to destabilize them so that they never get there. Europe is pretty much over, though, decadent and divided. China will fail economically, then split into regional powers easily manipulated against Chinese stability. Also, constrained by history and culture, Japan, China, Korea will never be able to effectively work together to create a regional power stable and strong enough to balance the US. The only country that can do anything to rally Muslim countries around it is Turkey, the rest just fight among themselves and whenever one manages anything, America pulls the carpet from under its feet. Yet Turkey is a secular country so far and even with the strong hand of Erdogan it will never convince countries that are essentially religious barbarians. Last and most important, Russia, which will also fail because it relies too much on its hydrocarbon exports, something that the US will subvert by investing heavily in alternative energy sources and is surrounded by countries that will never fully come under Moscow control, with the US always encouraging the opposite. He then asserts that by 2080 Mexico will emerge as a competitor to the US.

Many of the comments online mention the shock value of dismissing European or Chinese importance in the world in the long term. Personally I feel that if the US will be such a comfortable global power, the world is going to be boring at the very best and probably really sad. Friedman himself wrote another book two years later called The Next Decade: What the World Will Look Like, in which he expresses his fear that so much power will corrupt the very foundation of the nation and turn republic into empire. Many feel that this century is so much different than any other and cannot be accurately predicted by looking back to history. "break it or make it" century, they call it. Let's hope it's the latter.

Other criticism goes towards the singular focus of the book on geopolitics and less on economics, technology, religion or culture. I believe he did that for shock value, also, trying to pull people into the discussion by underestimating or even completely ignoring things with so much emotional value for a lot of people. He basically said "the world works like this, not like you would like it to work, deal!", then waited for the comments. A bit trollish, Friedman is.

Finally, the more military oriented criticize Friedman for relying too much on conventional military paradigms and ignoring space warfare, WMDs and the informational angle. I can only consider this as a stabilizing force, rather than a destructive one. If the possibility that a pissed off enough player might destroy the whole board exists, then the actions of all the players will be more subdued than possible. Warfare was made more subtle, not more unpredictable, by this type of possibility.

Bottom line: an eye opening book, more valuable for its concise analysis of global history than its predictions, probably, and for explaining why so many countries behave like idiots. In the end, the very purpose of the book, that of predicting this century, is made moot by its thesis that it can be predicted. If that is so, then whatever happens happens no matter what anyone does. Also, I believe it is great material for fiction writers that want to ground their universes into reality. While the predictions themselves, either wrong or spot on, are irrelevant, the method for their creation is most interesting and worth investigating. I mean, George Friedman is not Hari Seldon, but he is the closest we've got.

George Friedman has a lot of video talks and interviews detailing his views. Once can easily look them up online.

Friday, April 21, 2017

Athens in the spring

I've just returned from vacation in Greece where I spent about three days in Athens, the country's capital. It was an interesting experience, mostly because it felt so depressingly familiar, but also because it showed both promise and disappointment at the same time.

General impressions


I would have liked Athens to look like this (click to enlarge):

An orange tree in bloom, smelling wonderful, with a lazy cat comfortably laying at its base, not a care in the world.

Instead, it was mostly like this:

A nice little building with traditional Greek balconies on a cozy street (with the mandatory orange trees), next to a derelict ruin covered in graffiti and garbage.

Indeed, for me Athens felt downright schizophrenic. The day we arrived we went by foot towards the very center of the city, the place where tourists go for expensive dinners in an area filled with restaurants. We had to walk on streets covered in garbage, populated by vagrants, or places where the only companies were Chinese import companies and the street was filled with dirty dark skinned people doing suspicious commerce. And no, I am not afraid of dark skinned people, but I was accompanying two women and I was damn nervous. Anyway, all this was not a shady part of the city, instead these areas were intermingled with lighted streets where restaurants and tourists were abundant. And in the less tourist part of the center of Athens there was the same story, only told by buildings. Prosperous companies housed next to unfinished, abandoned or really ugly constructions. It wasn't uncommon to see a whole first floor with the windows empty or barred with wood, with shops on the first floor. Vagrant people everywhere, and they didn't look like Syrian migrants, either. Only they didn't seem that violent and people walked around them as it was the most natural sight in the world.

It reminded me so much of Bucharest, only here the restaurants and shops are less expensive and the vagrants less common. In Romania, that kind of lack of social status and resources often breeds frustration, anger and violence. Police actively try to get rid of homeless people. In Athens it looked as if this mix of opulence and filth was a given. The traffic in Athens also reminded me of my home city, only again, it felt more extreme and more subdued at the same time. It was common to see people cross the street in the middle of the boulevard, cars and motorbikes rushing towards them, with not a hint of fear. Cars would stop and let them pass, the drivers obviously not happy, but not expecting different either. The behavior was validated by the crazy street lights that turned green then back to red in a matter of seconds on some large streets and boulevards, and stayed green a long time then went intermittently green before changing color on small and barely circulated roads. The "hop on, hop off" bus, nicely avoiding the streets where people were sleeping on the ground and keeping on the nice sides of the city, a double decker vehicle filled with people, would routinely stop in its course to wait for taxi cabs that would converse with customers or people randomly parking cars or scooters or whatever in the middle of the road. Again, in my home city this happens all the time, but people are angry with frustrated honking and loud swearing. The driver seemed quite calm driving through spaces that barely allowed the bus to pass or to wait for these people.

Food


Anyone who knows me also knows that I rate the quality of a place based on the taste of the local food. I could be surrounded by black beggars and still enjoy a good meal (as long as I don't have to smell people). However, the types of places you can eat at in Athens are also quite different. One can follow the TripAdvisor recommendations and find themselves paying 6 euros for a beer in an Irish café and eat crap for a lot of money; that if they even find the place there anymore, since it seems that the economics of the area are quite dynamic. One can go to where most people seem to go, and end up in a typical tourist trap tavern that gives them a Greek-style euro-food that doesn't mean anything, tastes like anything else and, again, is expensive as shit. Yet there is also the possibility you end up at a nice Greek tavern or some other type of place where you can eat and drink and enjoy both as well as the mood and atmosphere of the place. And as with other aspects of the town, you can find these types of locales one next to the other.

For example we went to the fish and meat market. It's a huge place where people try to sell you fresh fish, mollusks, lamb, pork and so on. After walking around and frankly getting fed up with the smell of fish in the place I was about to leave when I noticed in a nook of the market, out of the way, there was a tavern. I immediately went there. I mean, if people that work there also eat there using fresh ingredients that they sell there, it's gotta be good. And it was! We ate some really inexpensive stuff, with Greeks sitting (and smoking) at the other tables, all singing together with a guy playing the accordion. And let me tell you this: the songs that they sang and knew by heart were not the type of songs that outsiders connect to "traditionally Greek", although they were obviously so. And also the accordion guy was not expecting money or anything, he was playing because he liked it. I loved the place, although it was clearly "a bomb".

Similarly we found a Greek tavern right next to some fancy "cafés" that served expensive drinks and coffee and snacks that were barely food. We had moussaka and Greek salad with retsina and tsipouro and it was wonderful. We were slightly interrupted by some child beggars; they were Romanian.

Amazingly enough, I had no souvlaki, not for lack of trying, but because I was there with evil women who seemed bent on wearing my legs off with their damn walking and sightseeing! Also I was really attracted by some Indian and Bangladeshi places that seemed even more "explosive" than the market tavern. Yet they were in the area with all the beggars and import companies and I couldn't convince anyone to go there. I would have chanced it, maybe, if it wasn't that I had to fly to Bucharest the next day and going to the bathroom every half an hour would have been kind of difficult.

The Akropolis


It's a bunch of ruins on top of a mountain, infested by tourists and quite frankly mostly fake. I mean, the Akropolis museum is much more interesting and it also shows how many times the Akropolis was damaged, destroyed, raised and restored afterwards. To me, the picture there I felt the most true is this:

A mass of indistinct people sucking away any trace of tradition, history or sacred from a bunch of replica stones and statues that need heavy machinery to even stay in place.

For a moment I imagined they were installing the machines in order to make a transformer place. One could see Akropolis in various stages of its existence: press a button and suddenly the Parthenon is a mosque from the times of Turkish occupation, and the Erechtheion is where the harem is housed, press another and you get a church of Virgin Mary.

You want more, just google it.

The people


I've seen really tall muscular Greeks and also small little dudes. It seemed like there was a gap in the middle, where an "average" Greek was less found. Girls were as a rule rather ugly, with a tendency for being short and fat. I've seen cute Greek girls, but they were all young and far in between.

As a rule they were all rather polite, although we didn't interact with a lot of them. At one point we went to a tavern and the Greek waiter there spoke some Romanian words as many of the employees were from Suceava and he caught some of the language - he seemed to be enjoying his association with Romanian people. Also, for a place filled with homeless people, Athenians didn't seem to fear theft so much. I saw people leave their bag and cell phone on the ground while they went back to their motorcycle to get something and many shops that held products outside, ripe for the grabbing.

Conclusion


Athens didn't feel at all like a tourist city. Like Bucharest, it has its quirks and nice places, but its pragmatic purpose is to be a capital, not a place to explore and enjoy as a tourist. After two days there you have to ask some locals what else to look for and I bet that most of them would have to think hard before coming up with an answer. The city is a lot larger than its center, and we didn't go to see it all, so there are aspects that I am sure we missed, but the little I've seen shows a place of growth that was stunted by the country's economic collapse. It is not a place that is poor or rich, but rather something that feels diseased, with healthy tissue surrounded by corrupted one. Yet is it healing or delving deeper into sickness? That I cannot tell.

What I can tell you is that I don't regret seeing it, but I wouldn't go back there. My favorite experiences were smelling the blooming orange trees and eating at the fish market. The rest felt totally forgettable.

Tuesday, April 18, 2017

The Stars My Destination, by Alfred Bester

book cover In the first pages of the book I hear about a man who discovered teleportation when he was about to die. Like telepathy, it was a mental thing and most people seemed to be capable of it for short distances. I immediately thought it was quaint and that I was going to read one of those hopelessly out of date books. Indeed, published in 1955, the book didn't age well in terms of social or technological depiction, but it was really entertaining.

First of all, with all of its flaws, this book isn't boring. Alfred Bester managed to create a true antihero as the protagonist and maintained it as far as close to the end of the book. In The Stars My Destination (also known as Tiger! Tiger!) the hero is a brute who has no ambition, no desire for improvement, content only to exist. When left for dead on a derelict space rocket, his survival instinct leads him to obsessive hate towards the ship that didn't save him and his whole life turns to revenge against it. Imagine The Count of Monte Cristo in space, where everybody can teleport at will. And he is hardcore. The first thing he does when he gets back is train his teleportation powers and, when discovered by a negro woman (in '55 it was an OK word), he blackmails her with knowledge of her family and promptly rapes her. Yup, that's the hero.

The story gets a little bit inconsistent afterwards, as this low life unambitious person suddenly is capable of immense personal change, in behavior, knowledge and social status. However to follow his mad maniacal hunt for the thing that offended him is hallucinating. The world depicted by Bester is a quasifeudal multiplanetary society led by dynasties named after the successful brands at the time, like Kodak (yeah, I know) and devoid of any social justice or human empathy. In fact, when describing the emergence of teleportation, the immediate effects he predicts are diseases spreading through the world, carried by vagrants and immigrants who just teleport out of poor and backward countries in the civilized world (I told you the book has not aged well). Yet for all of this it is a mesmerizing world.

As the book was short, I finished it in a few hours, there is no reason not to delve into something that is both incredibly quaint and amazingly refreshing. While the ending felt a bit too inconsistent with the beginning, the story was interesting and I loved the flawed and brutal character, something I doubt you will see in any mainstream story today. Like its protagonist, it is one of those works that I couldn't not like, despite their many flaws.

Monday, April 17, 2017

The Long Way to a Small Angry Planet, by Becky Chambers

book cover I think I am way too trusting of book reviews, as I was with the one from Andrew Liptak about Becky Chambers' debut book The Long Way to a Small, Angry Planet. He said it was the most fun space opera book he'd read last year and the review was published in September, so I just automatically added it to my list without reading further for fear of spoilers. It was a bad idea.

The book is the space opera version of romance novels. There is a ship run by a quirky team of multispecies crew on their way toward a planet that is to become the interface point between the galactic federation analog and a new species of warring and incomprehensible aliens. So far so good. The problem is that the book is all about the one year trip there with the focus solely on the personal histories, dramas and emotions of the crew members. They fall in love with each other, they transgress stupid specieist prejudice, love conquers all, that sort of thing. Then the book ends, with everybody nicely paired and friendly towards everyone else. That's it. I mean, that is literally it. The book ends when one is already bored to death and waiting for some interesting stuff to happen. And it never does!

While I have to admit that 50 Shades of Grey was way worse and sold a lot better, that is in no way a recommendation to read this book. It is technically obsolete, morally ridiculous and abhorrently politically correct. It becomes pathetic to see how the author attempts to justify interspecies romance and sex and to condemn biases about other sentients, even inventing new pronouns, only to fall into other more boring clichés about what our future society should be like and how people should behave with one another and how nasty people look (unkempt fair skinned dark haired antisocial techs or chitinous insect like creatures) and how inner beauty translates to outer beauty and the making of easy friends and so on. It felt like a highschool story with aliens. I mean there was a moment when their ship is boarded by pirates and the resolution is to politely talk to them and reach an agreement, because this particular species was culturally bound to only take what they need and no more. Really?

Bottom line: it is a puerile make believe fairy tale about space lovers which has almost no science in it. It is a another fantasy novel that tries to trick readers in by posing as science-fiction, only it is a romance fantasy novel. And if you are eager to read passages of interracial space sex, forget it, the most controversial word you will see printed in this book is "banging" and I believe it is used but once.

Saturday, April 15, 2017

Finity's End (The Company Wars #7), by C.J.Cherryh

book cover I don't remember where I got the idea to read Finity's End, but I had no idea it was one book in a long series of Merchanter Aliance/Union books. So at the same time I liked that it started with a rich world and a very clear idea where it was coming from and going to, but also felt the missing information that I would have had if I had read the series from the beginning.

That being said, I have to say I liked the book. I found C.J.Cherryh's world building extraordinary and considering she has written more than 60 books, her attention to detail and the way things click was really nice. Yet at the same time, this made the story slower, more grounded in a larger reality that didn't really interest me.

The story of Finity's End is of a young boy who wants to live on a planetary station and study the intelligent indigenous life with which he made the only personal connection he values. Instead, he is being pulled up to a spaceship he doesn't care about for the only reason that his mother was originally born there. Faced with prejudice and culture shock, his story of adapting to the new environment is a lot more interesting that the political and economical dealings the ship is engaged with and often I felt that, while I appreciated the realism of the plot, I couldn't wait to get to the personal part, with the characters I really cared about. Perhaps if I had read the entire series I would have felt more connected to older characters and less to this adolescent coming of age subplot.

I found it interesting the author's description of two entwined cultures that live in different space and even different time: there are the planet and station folk and then there are the space ship people. They interact, but for most of their existence they are almost different species. Perhaps if the viewpoint on this was more modern I would have enjoyed it more, but as such, it felt like a book written in the 70s.

Bottom line: I liked the book, but not so much that I will start reading the others in the series. I liked the world building and I loved the way the characters subtly evolved in their interaction with each other. I didn't really connect with the larger plot of trying to bring peace to the galaxy and I felt nothing towards the Mazian boogieman who never made an appearance in this book. While I believed the possibility of a future like that, the technological part of the book felt quite obsolete to me, even if the publishing date for Finity's End is 1997.

Using multiple projects in Visual Studio Code

A reader asked me how to work with multiple projects in Visual Studio Code and after fumbling a little I realized I had no idea. So I started trying out things.

First I created a folder in which I created two other folders ingeniously named Proj1 and Proj2. I went in both and ran dotnet new console and dotnet new classlib respectively. I moved the Console.WriteLine("Hello World!"); code from the console Program.cs in a static method in the Class1 class, then called the method from Program.cs Main, then tried to find ways of referencing Proj2 from Proj1 in Visual Studio Code.

And here I got stuck. I tried the smart solutions VS Code recommended, but none of them included adding a reference. I right clicked on everything to no avail. I wrote using Proj2; by hand hoping that Code will magically understand I need a project reference. I googled, only to find old articles that discussed project.json, not .csproj type of .NET projects.

In the end I was resigned to write the reference by hand. I opened Proj1.csproj and added
<ItemGroup>
  <ProjectReference Include="..\Proj2\Proj2.csproj"/>
</ItemGroup>

After saving the file and going to the unresolved Class1 reference, I now got using Proj2; as an option to fix it. And now I got to the problem my reader was having. When trying to run Proj1, I got Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Proj2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified. at Proj1.Program.Main(String[] args).

It's disgustingly easy to solve, you just need to know what to do. Either Ctrl-Shit-P and type restore, then select restoring Proj1 or do it manually by going to the Proj1 folder and running dotnet restore by hand. After that the project is compiled and runs.

Summary:
  1. add project reference by hand to .csproj file
  2. resolve whatever compilation errors you have by specifying the correct usings or inlining namespaces
  3. dotnet restore the project you added references to

Thursday, April 13, 2017

Lambdas, LInQ, Javascript and so on

As a .NET developer I am very familiar with LInQ, or Language Integrated Queries, which is a collection of fluent interface methods that deal with querying data from collections. However, so many people outside the .NET ecosystem are not familiar with the concept or they use it as disparate functions in their language of choice. What makes it even more confusing is that the same concept is implemented in other languages with different names. Let me give you an example:
var arr=[1,2,3,4,5,6];
var result=arr
  .Where(v=>v%2==0) //get only even values
  .Select(v=>v*10)  //return their values multiplied with 10
  .Aggregate(15,(s,v)=>v+s); //aggregate their value into a sum that starts with a seed of 15
// result should be 15+2*10+4*10+6*10=135

We see here the use of three of these methods:
  • Where - filters the values on a condition
  • Select - changes the values it returns
  • Aggregate - creates an aggregate value using an operation on all the values in the collection

Let me write you the same C# code without using these methods:
var arr=[1,2,3,4,5,6];
var result=15;
foreach(var v in arr) {
  if (v%2==0) {
    result+=v*10;
  }
}

In this case, some people might prefer the second version, but it is only an example. LInQ is not a silver bullet that replaces all loops, only a tool amongst many in a large toolset. Some advantages of using such a method are concise code, better readability, a common API for iterating, filtering and querying collections, etc. For example in the largely used Entity Framework or its previous incarnations such as Linq over SQL, the queries would look the same, but they would be translated into SQL and sent to the database and executed just once. So it would not get a list of thousands of records to filter it in memory, instead it would translate the expression of the function sent to the query into SQL and execute it there. The same sort of operations can be used on streams of data, rather than fixed collections, like in the case of Reactive Extensions.

Some other methods in this set include:
  • First/Last - getting the first or last element in an enumerable that satisfies a boolean condition
  • Skip - ignoring a number of values in a collection
  • Take - returning a number of values in a collection
  • Any/All - returning true if at least one or all of the items satisfy a boolean condition
  • Average/Sum/Min/Max - specific aggregating methods for the elements in the collection
  • OrderBy/OrderByDescending - sorting
  • Count - counting

There are many others, you can look them up here.

Does this system of querying data seem familiar to you? To SQL developers it will feel second nature. In SQL the same result from above would be achieved by using something like:
SELECT 15+SUM(SELECT v*10 FROM table WHERE v%2=0)

Note that other than putting the source of the data in front, LInQ syntax is almost identical.

However, in other languages this sort of data query is called map/reduce and in fact there is a very used programming model called MapReduce that applies in big data processing. In Java, the function that filters data is called filter, the one that alters the values is called map and the one that aggregates data is called reduce. Similar in Javascript. Here is the same code in Javascript:
var arr=[1,2,3,4,5,6];
var result=arr
  .filter(v=>v%2==0) //get only even values
  .map(v=>v*10)  //return their values multiplied with 10
  .reduce((s,v)=>v+s,15); //aggregate their value into a sum that starts with a seed of 15
// result should be 15+2*10+4*10+6*10=135
Note that the lambda syntax of writing functions used here is new in ECMA Script version 6. Before you would have to use the function(x) { return [something with x]; } syntax.

In Haxe, the concept is achieved by using the Lambda library and the functions are again named differently: filter for filtering, map for altering and fold for aggregating.

There is another sort of people that would instantly recognize this model of data querying: functional programming people. Indeed, SQL is a functional programming language at its core and the same standard for data querying is used very efficiently in functional programming languages, since they know whether a function is pure or not (has side effects). When only dealing with pure functions, some optimizations can be made on the query by the compiler before anything is even executed. Haskell has the same naming as Haxe (filter, map, fold) for example.

So whenever I get to review other people's code, especially people that have little experience with either SQL or C#, I cringe to see stuff like this:
var max=-1;
for (var i=0; i<arr.length; i++) {
  if (max<arr[i]) max=arr[i];
}
In my head this should be simply arr.max(); And considering how easy it is to implement something like this in Javascript, for example, it's a crime for not using it:
Array.prototype.max=function() { return Math.max.apply(null,this); }

Yet there is more to this than my personal preference for reading code. Composition, for example. Because this works like a fluent API or a builder pattern, one can keep adding conditions to a query. Imagine you have to filter a list of strings based on a Google like query string. At the very minimum you would need to split the query into strings and filter repeatedly on each one. Something like this:
var arr=['this is my special query string','this is a string','my query string is this awesome','no query strings here, move along','these are not the strings you are looking for'];
var query="this is a query string";
var splits=query.split(/\s+/g);
var result=arr;
splits.forEach(s=>result=result.filter(a=>a.includes(s)));
console.log(result);

There is a lot of stuff I could be saying about this subject, but I need to summarize it. It's all about inverting loops. Instead of having to go through a collection, a stream or some other data source, then executing some code for each element, this method allows you to encapsulate the operations you want to execute on those elements, pass them around, compose them, translate them, then use them on any data source in the same way. A common API means reusability, better readability of code, less written code and a simpler declaration of intent. Because we get out of the loop system, we can expand the use for other paradigms, such as infinite data streams or event buses.

Fear and Hope

It occurred to me recently that the opposite of fear is hope. Well, of course, you will say, didn't you know that? I did, but I also didn't fully grasp the concept. It doesn't help that fear is considered an emotion, yet hope a more complicated idea.

I was thinking about the things that go wrong in my country and some of it, a large part, comes from bad laws. And I was trying to understand what a "bad law" is. I tried some examples, like the dog leash one - I know, I have a special personal hate for that one in particular - but I noticed a pattern. It's not about the content of the law as it is about its trigger. You see, lawmen don't propose and pass laws because they like work, but because there was an event that triggered the need for that law. Law is always reactive, not proactive. It could be proactive, but there is a lot more effort involved, like convincing people that there is an actual problem that needs addressing. It's much easier to wait for the problem to manifest and then try (or pretend) to fix it.

Anyway, the pattern that I noticed was related to the trigger for individual laws. The bad laws were the ones that came out of fear. One kid got killed by stray dogs, kill them all and institute mandatory leashes on pets. The good laws, on the other hand, come from hope. Lower taxes so people are more inclined to work and thus produce more and so get more tax in. Hopefully people will not be lazy.

And it's not only related to laws, but to personal decisions as well. Will I try a new thing, hoping that it will make me better, teach me something, be fun, or will I not try it because it is dangerous, somebody might get hurt, I may lose precious time, etc? When it is so abstract it's almost a given that you will take the first choice, yet when it is more personal fear tends to paralyze.

Fear is also contagious. The people who want us to be afraid are afraid themselves. Control freaks, power hungry people, they don't want to take us to a better place because they are afraid to lose that control, because they are afraid of what might happen. And their toolkit is based on fear, too. Something exploded and killed people, some asshole drove a car into people: we must ban explosives, cars and - just to be safe - people. Don't go to space because people might die, although they die every second and most of the time you don't care about it. Let's hoard money and things because we might not get another chance to have them, because we might lose them, because we are so afraid. The fear people don't know any other language but fear and they will use it against you. Much easier to instill fear than to give hope, so hope is not that contagious. It is fragile and it is precious.

I submit that while fear might keep us safe it will never make us happy. The very expression "to keep safe" implies stagnation, keeping, holding, controlling, restricting freedom.

So here is my solution. As Saint-Exupery said, perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. Let's strictly define our safe zone, or the area we need to be safe in order to not be afraid. Personally, as a group, as a country, as a planet, let's set the minimum requirements to being safe, a place or situation we can always retreat to and not be afraid. Whether it is a place that is your own, or a lack of debt, or a job or business that will give you just enough money to survive and not spiral out of control, a relationship or some other safety net, everyone needs it. But beyond it, let's abandon fear and instead use hope. Hope that you can do more, you can be better, you can live more or have fun, that other people will act good rather than badly, that strangers will help rather than harm you, that the unknown will reveal beauty rather than terror.

I will choose to define good decisions as coming from hope. Will that hope be proven to be unfounded? Maybe. But a decision based on fear will never ever be good enough. And if all else fails, I have my safe zone to get back to. And I know, I very much know that having a place to get back to from failure is a luxury, that not many people have it as good as I do, but to have it and still live in fear, that's just stupid.

Saturday, April 08, 2017

Song of Kali, by Dan Simmons

book cover A friend of mine recommended this as one of his favorite books, so of course I went into it with very high expectations and of course I was disappointed. That doesn't mean it's a bad book, just that I expected more than I've got.

In Song of Kali, Dan Simmons describes Calcutta as a place of evil, in a culture of filth and senseless violence and death. He goes there with his Indian wife and their infant child when he is called to retrieve a new manuscript from a supposedly dead Indian poet. A lot of culture shock, a lot of weird mystical events and some weird and horrible people that do horrible things is what the book is about.

In 1985 this was perhaps a fantastic story, I don't know, but now it feels a little bit cliché: American man goes somewhere he sees as completely alien and where he feels out of place, usually going there with the family, so that the empathy and horror can be heightened, and where abnormal things he has no control over happen. It also part of a category of stories that I personally dislike: the "something that can't be explained or controlled" category, which implies absolutely no character growth other than realizing there are situations like that in which one can find themselves. And indeed the book is all like that: stories that make little sense, but somehow are linked to the perceptions and experiences of the protagonist, mysterious characters that do things that mean little unless the story takes them exactly to a certain point, at which you are left wondering how did they know to do that thing, and a lot of extraneous details that are there only to reinforce the feeling of disgust and dread that the character feels, but do little to further the story.

In the end, it is just some weird ass plot that makes no sense, a bunch of characters that you can't empathize with (some of them you can't even understand) and a big fat "It is so because I feel it is so", which is so American and has little to do with me. Others agree that the book is most effective when describing the humid fetid heat of the city and the inhumanity of its inhabitants and less with the so called "horror" in the text or the connection the reader feels with the characters. It brings to mind Lovecraft and his strong feelings about things that now are banal and CGI in every movie. Some are even more vehement in their dislike of the book. Here is another review in the same vein.

So how come so many people speak highly of the novel? Well, my guess is that it affects the reader if they are in the right frame of mind. My friend told me about the part that he liked in the book and, frankly, that part is NOT in the book, so whatever literary hallucination he had when reading the book I had none of it. My rating of it cannot be but average, even considering it's a debut novel that won the 1986 World Fantasy Award.