Book Review

Working Effectively with Legacy Code – Book Review

Working Effectively with Legacy Code – by Michael Feathers – covers how to refactor and add features to legacy code without breaking it. Legacy code, in the book, is just code without proper tests.

Of course, refactoring code without tests is always dangerous because it might be much harder to find any new bugs you have introduced.

The book covers many techniques with steps you can follow to make it easier and safer to apply these changes. The steps are well explained, with many good examples. There is also plenty of coverage on how to introduce tests on code that wasn't made with unit testing in mind.

Use of techniques in practical problems is also covered in the chapters before these sections, with titles such as I Can't get this Class into a Test Harness or This Class is too big and I don't want it to get any bigger.

There is some cross over with the Refactoring classic, but even in those cases the different context makes this worth your time.

Strongly recommended to anyone that needs to work on codes without tests.

Book Review

Design Patterns – Book Review

I believe this is the third time I read Design Patterns: Elements of Reusable Object-Oriented Software  – by Erich Gamma, Ralph Johnson, Richard Helm and John Vlissides. This is the first time I bother to review a book I have read before, but this is such a classic it is hard to avoid.

The Wikipedia definition of a design pattern is a “general reusable solution to a commonly occurring problem within a given context in software design”. The point of the book is cataloging the most generic and useful patterns. Most patterns also have little analysis of details on ways you could implement them.

Every time I read this I appreciate it more, and come up with better ideas on how to improve the design of my classes.

Some people seem to think it is too heavy and technical. Personally I like it, but if you want something lighter, check out Design Patterns Explained: A New Perspective on Object-Oriented Design (which I am stunned to realize I never got around to reviewing), which is a simpler review of design patterns.



Book Review

Clean Code: A Handbook of Agile Software Craftsmanship – Book Review

Clean Code: A Handbook of Agile Software Craftsmanship, by Robert C. Martin is a book about how to keep your code readable, flexible and naturally bug free.

It reminds me, of course, of Code Complete, which I really liked when I first read it (1997). Clean Code is much weaker on the research side (i.e.: there is a big difference between say “this is bad because I say so” and actually showing references to research that prove that a specific practice causes more bugs).

However, as far as I remember the coverage of OOP in Code Complete was much weaker, and this is where Clean Code shines. There are plenty of interesting and useful ideas on how to clean your classes, when and how to refactor them, and much more. There are also some practical refactorings of  real code, which I found somewhat useful – mostly because I read the book on an iPad, and switching around to keep track of what happened is somewhat painful in comparison to flipping a page.

Other than that, I strongly recommend the book for coders everywhere – just keep in mind that all the samples are in Java! I haven't used Java in years but I could still keep up with everything.

Book Review

Visualize This: The FlowingData Guide to Design, Visualization, and Statistics – Book Review

Visualize This: The FlowingData Guide to Design, Visualization, and Statistics – by Nathan Yau, covers data visualization, including how to get, parse and visualize the data.

There is plenty of code in several languagues (R, Python and JS mostly, with some Flash), and there are plenty of great looking results which really tell the story well.

If you are interested in Data Visualization in general or just need to make some maps with points in it, this is a great book.


Visualize This

Book Review

Interactive Data Visualization for the Web – Book Review

I've just finished reading Interactive Data Visualization for the Web (An Introduction to Designing with D3), by Scott Murray. This book covers the basics on how to use D3, a library to make it easier to do data visualizations (see the very cool gallery for an example of what has been done with it).

This is Early Release Version 3 of the book, so there may be changes in the finished release.

The book covers the basics on how to use D3 – starting with a bar chart all the way to how to convert shapefiles and display maps.

One thing I found interesting is how similar using D3 feels to JQuery. They very much are helper libraries. I expected D3 to be more of a delphi component – point it to the data, set a few parameters and it goes from there. But in reality, there will be a quite bit of code for anything you do. The advantage is that it is very, very flexible.

The style of the book is quite light, and it is targeted to all users who want to do data visualization – not just programmers. Thus, there is a quick introduction to a lot of basics, including the Web, HTML, DOM, CSS, Javascript and SVG. It seems feasible that a dedicated reader would be able to follow it without much programming experience.

Overall, I liked it. The examples all work and are useful, and it took me about 4 hours to read it, including trying out all examples and following some of the links to useful resources.

Book Review

R Graphics Cookbook – Book Review

I have just finished looking through (and trying out) the recipes in R Graphics Cookbook, by Winston Chang. First of all, I'm very much a beginner in R, but it was possible to follow the examples.

For those wondering what R is – it is an interesting language for statistical computing and graphics. Usually I am more of a Delphi guy (although I have used many other languages in the past, and still use PHP when adequate), but R has a bunch of features and libraries that makes it easier for that area, and it is also used on a few courses – thus my interest.

One thing I really liked about the book is that the example data comes straight from a package. So you install and download them with a simple command in R when you start the book, and you just have to do a library(gcookbook) each time you use an example in a session. Very nice (vs downloading, setting a folder or using the full name for each file,etc).

The book seems to cover the material well enough, and the discussion section usually present useful options. For example, on the recipe Labeling Points in a Scatter Plot the basic solution is presented, and then it shows how to shift labels so they don't crowd the data points, or how to add only a few relevant labels. The examples I tried almost all worked (except for one that needed an extra library, which only took a install_packages call), which unfortunately is not true for many technical books.

Since my background only include the most common graphs, I also learned about a few other graph types, such as correlation matrix, dendograms, vector fields and choropleth map.

Overall, pretty good.

It is interesting to note that this was a free review copy – fortunate, too, since I had almost bought it a few days before getting an offer to review it.

You can get it directly from O'Reilly or other places. The advantage of O'Reilly is that their e-books are DRM-free (and usually available on mobi, PDF and ePub formats).

Book Review

The Art of Readable Code – Book Review

The Art of Readable Code – Simple and Practical Techniques for Writing Better Code – by Dustin Boswell and Trevor Foucher – is a book on advice on making your code more readable.

Why would you want your code to be more readable? It might not seem so important while you are coding, specially if you are a solo developer like me. But when you next have to change or debug something in your code, you will be grateful that you spent the extra time. Not only that, but it is much easier to find bugs on readable code.

One book I will always remember is Code Complete, by Steve McConnell. I read it the year after I finished university, and I immediately loved it. It was full of useful techniques and ideas on how to make your code better – more readable, less error prone, better formatted, etc. And it used plenty of studies to demonstrate what really worked.

I bought The Art of Readable Code half expecting it to be a poor version of Code Complete. I was very pleasantly surprised to find to be not only a nice, fun read but also full of interesting ideas and excellent examples.

When I finished, my Kindle version was full of highlights and bookmarked pages.

Highly recommended.

Book Review

The Developer’s Code – Book Review

The Developer's Code – What Real Programmers Do – by Ka Wai Cheung is supposed to contain “nuggets of wisdow” on how to sustain a healthy relationship with your work.

Overall, I found a few interesting tidbits on the whole thing. It is a relatively pleasant read and worth the time to read it and the price of the book.

What I liked:
– The Parallels between architecture and developing – and why some of the architectural metaphors can make planning excessive for software
– Perk can be destructive for higher-level thinking (according to a TED talk from Dan Pink on motivation)
– If you can, start writing the most interesting part of o program and work out from there
– First impressions of a program can be skewed because we don't know how we will conform to it
– Suggestions on how to schedule pet projects
– Make two things better about the software each day – even if they are small items such as better error messages and comments
– Some techniques for handling your to-dos
– the off-time concept – where for two hour shift per developer, there are no interruptions
– the generals ideas on code generation.

Book Review

Killer Headlines for Web Content – Book Review

Killer Headlines for Web Content, by Nick Osborne is an e-book by WordTracker.

It is more of a report than a book, at 65 pages. This is a problem in the sense that it limits the amount of content it covers, but it also makes it a quick read.

The book proposes to cover a few approaches so that you can write better headlines.

It does have good suggestions – mostly the classic approaches (numbered lists, fear, how to, etc) – but it does feel quite oriented for news and generic articles, rather than business content. It does mention this in the Introduction, and says that these headlines work, and it is your job to fit it to your pages and articles to make them work.

I feel that the approaches were reasonably well covered, and it did give me a few ideas. I might even look at my notes when I'm looking for a good headline.

At the current discounted price – US$19 – I feel that the book is worth its price, but I wouldn't recommend it at its full price.