Sunday, 30 December 2007

A Quantum Murder by Peter F. Hamilton

A Quantum Murder comes to continue the story of Greg Mandel, psychic detective. Does it sound tacky? I agree that the subject is not the best possible choice, but the writing is good, Hamilton style: scifi social speculation, action, a detective story that makes the reader wonder what will happen next and whodunit!

I personally did enjoy the book, but it wasn't even close to the latest and more hard scifi writings of Peter Hamilton's. Maybe it's just me, but mental detectives in a post apocalyptic corporate world just doesn't do it for me. Maybe that's why The Nano Flower's first chapter starts with Suzi doing tekmerk stuff ;)

Again, the second volume of the three Mindstar books is stand-alone, making it easy to read even if you didn't read the first book. It is basically a scifi policier.

Thursday, 27 December 2007

Mindstar Rising by Peter F. Hamilton

Another great book from Hamilton! This is part of the "Greg Mandel trilogy", that meaning there are three books to show for this particular side of the Hamilton universe, and unlike his later work, Mindstar Rising is actually a stand-alone book. You can read it without its next two parts and understand it as a single story. I've even started to read A Quantum Murder (volume 2) and Hamilton is making the effort to summarize what the characters did in the previous volume.

I understand the dilemma facing such a prolific writer: should one break a story in stand alone segments, thus cauterizing story arches and trying to put every single idea into single puny volumes? Should one bore the readers with summaries of previous volumes? Or should one write huge three volume books that you need to read in their entirety to understand anything? :) It would be a hard choice for me, as well. All I can say is that I enjoyed the big stories as well as the more common way of writing one book stories and reminding the reader of previous stories. I highly recommend the Seafort Saga for this particular style, even if it grows old by the eighth volume. Consider it, though, I was attracted to the story by accidentally reading volume 3 and understanding all of it!

Anyway, back to the book that I was reviewing, damn it! Mindstar Rising describes a post apocalyptic Earth, where global warming and subsequent social and economic disasters brought civilization to the brink of dissolution. A psychic ex-military, now working as a private eye is asked to help in finding the source of industrial sabotage and from then on it just gets more complex and thrilling. I wouldn't say that this is one of Hamilton's better books, though. Even if the book is definitely fun to read, it pales in comparison with Night's Dawn or the Commonwealth Saga. It is more like Fallen Dragon in style, although I do hope it doesn't end in the same ridiculous way.

More to come as I read the next two books.

Pro .Net 2.0 Code and Design Standards in C# - by Mark Horner

book cover This book started great. It outlaid a structured view of how a software company should function, from the way one designs projects, to code and documentation standards. I really hoped this was the mother load: a book that would show me how a "standard" IT company functions on every level. It wasn't. Mark Horner started it well and ended it badly. A shorter book and more to the point would have been enough.

Bottom line, the book starts in an interesting way, describing what I would call "IT gap analysis", in other words the application of a simple idea: begin with a detailed (and documented) picture of what the current (start) situation is, then describe just as much detail the situation you want to reach (end). From then on, the job of describing the transition becomes orders of magnitude easier. That applies to software projects (start with what the client has and needs, then create the plan to bridge the gap), documentation (start with the functional and end with the structural) and ultimately code (start with abstract classes and interfaces, then fill in the missing code).

Other than that there are some (hopefully) nice references, then a lot of empty space filled up with irrelevant things: description of design patterns (which are nice, but there are books for something like this), a glossary of terms (some were never even used in the book!) and then the general way of describing something, then adding the "Standard acknowledges" part that basically says the same thing as his own description. It generally felt as a student paper from one that needed only a passing grade.

Sorry Mark, better luck next time. I will add here a short summary of what yours truly thought was noteworthy in the book:
  • use gap analysis for all the levels of your software work. When you define what you have and what you need, filling the blanks becomes easier.
  • use functional documentation, design documentation and structural documentation to detail what you wanted the software to do, how you designed to solve the problems and what are the basic building blocks of the project (classes, patterns, etc).
  • use code standards and peer reviews and even external code auditing to improve the quality of code. Refactoring is a must. Popular code development methodologies include Extreme Programming and Rational Unified Process.
  • use a design standard like the open-source architecture framework (TOGAF)
  • the enterprise vs. domain dichotomy. Should a software be started from scratch and done for the current set of requests only, or should it be designed as a general component ready for reuse? I would really go towards the enterprise, even when the profit from the extra work is not immediately obvious. Sometimes things that you have prepared in advance and nobody acknowledged become a real time (and life) saver when unreasonable requests tumble down upon you.
  • also linked to the enterprise/domain issue: an application framework solution. Create a basic Visual Studio solution that contains common components used in many projects and use it as a startup solution.
  • use the Visual Studio formatting options to keep your code well formatted. Use a standard of naming variables, methods, properties. My own choice is using lowerCamelCase for inner variables, prefixing the name with an underscore for fields. UpperCamelCase (or Pascal) for methods, properties and class names. Hungarian notation for controls (lbName for a label with a name). I don't really care if one names the control txtName, tbName or tboxName, as long as the prefix is revealing.
  • use the Obsolete attribute for methods and properties that are intended to be removed in the near future. In my own library I have used methods that became obsolete with the coming of .NET 2.0 and used this attribute to point not only to the obsolescence, but also to the blog entry detailing the reasoning behind it.
  • this is basically derived from other sources, but I do think it is relevant: best practices recommends using composition over inheritance, wherever possible. I admit that the coding of composition is much more complex, but with the refactoring tools found in Visual Studio and its add-ons (like my beloved Resharper), it becomes similar in complexity.
  • references:
    1. book: Programming C# by Jesse Liberty, published by O'Reilly
    2. dude: Martin Fowler is a leading authority on refactoring
    3. books to understand object-oriented development: Object-Oriented Analysis and Design with Applications by Grady Booch, published by Addison-Wesley in 1994
    4. Expert C# Business Objects by Rockford Lhotka, published by Apress in 2003
    5. book: Code Complete, by Steve McConnell, published by Microsoft Press 2004
    6. authorities on design patterns: Martin Fowler, Gregor Hohpe, Bobby Woolf
    7. dude: professor Trygve Reenskaug and his discussion on the role of object collaboration: Role Modeling and UML-VM discussions


My conclusion: read my summary and you don't waste two days of reading time.

Friday, 21 December 2007

Javascript regular expression split inconsistent between browsers

I was asked to fix a bug and I soon found out that the "bug" was actually IE's regex split implementation! You see? When you split by a string, the resulting array does not contain any empty spaces found!

Ex: 'a,,b'.split(/,/) = ['a','b'] in IE and ['a','','b'] in FireFox.


Searching the web I found this very nice page from regular expression guru Steven Levithan: JavaScript split Inconsistencies & Bugs: Fixed!. You can also find there a link to a page that tests the issues with your browser's Javascript regex.

Bottom line! Use Steven's code to regex split in Javascript.

Wednesday, 19 December 2007

Holly tea!

I was bent on writing an article about tea. You see, tea :) is a word often used instead of "infusion", but the definition of the word says it is specifically an infusion of Camellia sinensis, or the tea plant. I drink tea a lot, although I prefer to alternate the different tastes as much as possible. Tea plant

But the tea and coffee plants are far from being the only ones used for energizing drinks. In the Theaceae family alone there are a few species that are traditionally used for infusions.

Then there is the mate, from Yerba Mate, a species of the Holly (Ilex) family. Ilex paraguariensis, the mate plant
Other members of the Ilex family are used for traditional drinks.

The Roiboos infusion is an African tea made from a plant that is part of the legume family! I've tried it and I didn't enjoy it much.Aspalathus linearis, or the roiboos

How about a little Coca to boost the spirit? The "Coca tea" or "mate de coca" is a traditional drink in the Andes. Coca Erythroxylum, the coca plant

You can try Bubble tea made from Tapioca, the processed root of the Cassava plant.Manihot esculenta, the manioc, yuca or cassava

All these links are giving me headaches, but there is more! The stuff above is just the tip of the iceberg, or the most famous plant infusions that are known as tea, because there are all the other plant infusions that are covered by the more generic term "Herbal tea". On that particular page you can find over 60 herbal infusions not made from the tea plant, including mate.

Please follow the plethora of links as I can assure you you will find a lot of interesting things there. This also got me thinking of the way the markets are functioning right now. I drank about every possible tea I could commercially find without looking too deep and I've only experienced tea and mate infusions. How about all the others? When will I be able to drink tapioca tea or coca tea? The plant itself is not illegal! Perhaps deeper digging in the commercial part of the Internet will help me find sources for some of the drinks above. Also, if I only had the time, I would try to learn about herbalism.

Eh, enough of this. Now I must add the images to the post and hopefully someone will read it.

Monday, 17 December 2007

Sunday, 16 December 2007

Darwin's Children by Greg Bear

Bookcover imageDarwin's Children comes to continue the story from Darwin's Radio.

My general feeling is that this is not a very good book or series. The basic ideas that started it are interesting, although pretty hard to advocate to a scientist, certainly interesting from a literary point of view, giving multiple opportunities for tension, drama, unexpected, etc. Unfortunately, Greg Bear failed to capitalise those ideas, writing a book that has only a few characters that kind of stumble upon the most important clues for the book subject; it all happens in the USA, with almost no regard to what could or would have happened elsewhere. In a time of a great crisis, the international situation is put on hold, like every nation would take a time-out and ignore its neighbours. And the style is really not touching any emotional chord whatsoever.

Let me summarize: the sudden leap in human evolution is treated by the politicians as a disease, the new species being imprisoned in what could only be described as concentration camps. The entire U.S. democracy and freedom collapses like a giant soap bubble, while the fear of every child bearing family transcends to racism and fascism in no time. The few enlightened people that understand what is going on and try to protect the evolved offspring are also persecuted and surveillanced.

So here we have the eternal American obsession with children in distress and terrified families combined with concentration camps for some of their children, racism and civil disobedience, a newly discovered and frightening evolutionary mechanism, cutting edge genetics and archaeology. This could have been a fantastic story! But no, what came out was an impersonal account of hard to believe actions or feelings coming from emotionally stunted characters. And what was worse is that whenever the tension grew and there was a hint of a great thing happening, the author would make a sudden leap in time, after all had already happened, without describing much anyway.

Also, Darwin's Children is the last book of the series, while the story (as far as I am concerned) stopped halfway through, with no reasonable conclusion. Bottom line: not worth the time.