Book Review: The Closers, Michael Connelly

I bought this book from a charity book shop, so it could have come anywhere in the timeline of the Harry Bosch series. I was quite amused that this one heralds Bosch coming out of retirement to work in the Open-Unsolved Unit of the LAPD – the last book that I read in this series was when he came out of retirement after he’d left the Open-Unsolved Unit!

Bosch and partner Kiz Rider are assigned to investigate the murder of a schoolgirl many years before. The case is being reviewed in the light of DNA evidence – they hope that blood on the murder weapon will lead them to the killer. As might be expected, they witness the devastating effect the crime had on the girl’s mother and father. The mother’s life is on hold years later, waiting for resolution. The father has lost his career and is homeless – but Bosch tracks him down. He finds that the man blames himself for letting his daughter down, having been scared off from asking questions about the investigation by senior members in the LAPD.

Whilst the investigation necessarily follows the car mechanic whose blood was found on the gun, the investigators know that he may not be the killer. They need to link him to the girl somehow – probing attendance at the same school or overlapping social circles in the town. Yet, none of the girl’s friends recognise the man.

Four Stars

Leave a comment

Filed under Book Review

Book Review: The Midnight Line, Lee Child

This is the 22nd book in Lee Child’s Jack Reacher series and it continues where the 20th book, Make Me, finished. Any hope that Reacher’s collaborator in the previous book, Michelle Chang, would feature again were immediately dashed – but Reacher does work with an ad- hoc team in this one, and those tend to be the best of his adventures.

The premise of the book is that Reacher sees a small West Point ring in a pawn shop and decides to track down the (presumed female) owner and return it to her. Being an alumni himself, he feels a duty to help someone down on their luck. He allies himself with a detective, Terry Bramall, who also happens to be looking for the owner of the ring – employed by the beautiful sister of the owner. Finding the woman is only the beginning – the issues causing her to pawn the ring (battlefield injuries and drug addiction) are far harder to solve.

The next book in the series will be called Yesterday.

Four stars

Leave a comment

Filed under Book Review

ACCU Meetup: Code Craft

Jason Gorman of CodeManShip gave an interesting talk on code craft this week. The talk began with the business case for Code Craft, based on the cost of changing a line of code. If you compare the number of changes in source code repository to the expense of their development teams, the cost generally increases massively over time – 40X more expensive per line of code change after 8 years for one company. The same hockey-stick chart appears in Kent Beck’s book “Extreme Programming Explained”. Code Craft skills tend to flatten the cost-of-change curve, which is good for the business, and make the code easier to change, which is good for the developers.

Code Craft Skills

Write good unit tests, use version control, do continuous integration, apply design principles, refactor code safely.

Cost – if the cost of a change in design is 1, then the cost in implementation is 6.5, in testing is 15 and in maintenance is 100.  Bringing testing forward in the development process gives a massive return on investment.  Legacy code can be defined as any code that doesn’t have fast running, automated unit tests that can discover a bug quickly – enabling a cheap fix.  You must automate testing and enable the feedback loop to iterate quickly – ideally in minutes or seconds.

Readability – 50%-80% of time spent on a codebase is reading code, not writing it.  Making code easier to read and understand has a great pay-off.  Code that’s hard to understand is easy to break.

Complexity – attack complexity, try to replace it with the simplest thing, which is less likely to be wrong.

Duplication – never copy/paste code, especially off the internet!  You have no idea if it works or even compiles.  Making changes to common logic is multiplied if there’s duplicate code.  Duplication is the opposite of reuse – generate an abstraction to help improve the design.  Duplication can be hard to spot (e.g. customer playing several roles which could have been parameterised).

Ripple Effect – a change to one area of code breaks a much wider circle of code.  Cost of change greatly increased – need to have a local effect from a small change to code.

Principles of Clean Code

The speaker also coaches teams in the following principles:

1. Shorter feedback loops – automated unit testing.  Not possible with manual testing iterations or a manual testing phase.  Automated system testing can give good coverage, but is often too slow, can take hours to run.  Need to run in minutes or seconds.  Ideal chain is Unit Testing -> Integration testing -> System testing.  Want most of the testing in first layer, minimal number of smoke tests in the top System layer.

2. Simple Design – the code works, clearly reveals intent, free of duplication, made out of simple parts.  Need another pair of eyes to check the code is easy to read.  Code review your own code every few minutes.

3. Single responsibility – traditionally, this is taught as classes should only have one reason to change.  Or better, look at the number of combinations of the sections of code implemented in a function – it’s more powerful to break functions into smaller parts then use composition to implement the larger function.  Smaller components/functions => many more ways to re-use. So give each piece of software a single responsibility.

4. Tell, don’t ask – lots of low-level coupling between objects. Better to have objects sharing smallest possible interface to each other. Don’t pass the whole object – pass the data needed to do the operation.  Put the work where the knowledge lives – do the work in the right place so that data and behaviour belong together.

5. Dependency Inversion – you should be able to swap your dependencies.  Talk to dependencies as abstractions through interfaces.  Eg1 all commands inherit from ICommand and high-level components work on generic interface, not concrete classes.  Eg2 VideoRental example, rather than coupling to Imdb, replace with an interface.  Better for mocking/testing as well.

Leave a comment

Filed under Meetup, Programming

Book Review: The Right Stuff, Tom Wolfe

I wasn’t sure what to expect from this book. The phrase “The Right Stuff” is an established part of pop culture, but I hadn’t seen the film and didn’t realise this was a book based on true stories as told by the original Mercury 7 astronauts. Conversely, The Bonfire of the Vanities by the same author was fictional – yet made a similar impact on pop culture with Tom Wolfe’s portrayal of bond traders as “Masters of the Universe”.

Wolfe is brilliant at telling a story with such vivid description that you can picture yourself in the scene with the characters. He relates the horrors of plane crashes and the impact on the loved ones of the pilot, the endless waiting among the community of test pilot wives who are frantically guessing whose husband died today. And yet he does it with an upbeat style, because the survivors have to believe that it wouldn’t happen to them, and the reader needs to experience the incredible risks taken by the pilots from their point of view. The remaining cohort, by their continuing existence, prove to themselves every day that they would have found a way to avoid the crash – because they have The Right Stuff.

Suffice to say, this historical account changed my perception of the history of manned American space flight. It was fascinating to look back to a time when the astronauts were seen as mere monkeys dispatched into space on top of a rocket, and not as pilots at all. Initially, it was questioned whether the best test pilots would wish to give up their highly skilled and respected military careers. Yet by the end of the book, being an astronaut is to be a national hero, unquestioningly seen as the top of the pyramid, the highest achievement a flyer could reach.
Five Stars

Leave a comment

Filed under Book Review

How to report performance improvements

Bruce Dawson blogged about typical language when reporting speed-ups. Interesting that he found confusing/plain wrong examples in the real world as well as in software development. 

I usually try to communicate improvements in the style “10X faster” as well, to avoid any ambiguity. 

Leave a comment

Filed under Programming

Meetup: Workplace London, Facebook

I was lucky to receive another invitation to a private Facebook event, this time the first ever public event at their new offices at 1 Rathbone Square. The focus this time was on Workplace, an application developed entirely from the London offices of Facebook.

Ben Mathews – Practical Security for Workplace

Workplace is a product that helps people work together. It looks a lot like Facebook, but it’s a tool for people to communicate and share things for their work. The website, mobile apps and colour scheme differ from Facebook (so all your personal information is separated). Workplace places emphasis on groups and chat.

Well known companies using Workplace include Walmart, Starbuck and Heineken. These firms have formally adopted the product, it’s administered centrally and employees are members of the firm’s community while they work there. In other firms, the use of Workplace grows organically – employees can set up an account and invite colleagues to join groups (it’s free to use).

Key features include Live Video (great for presentations and Q&A globally), Workplace Chat (a desktop app neatly integrated into the OS) and Company Dashboard (for admins to look after the community).

Ben’s focus is on security for Workplace. There is a difference emphasis from consumer Facebook, where it’s vital to enable users to get back into their account, so multiple methods are supported, such as email/telephone/photo id/friends. For a workspace account, the account is linked more to the employer than to the person. When they leave the company, they should lose access. The basis is the business email account – if you still have access to your company email account, it is assumed that you still have access to the Workplace account. However, a person may work for multiple firms (e.g. main employer and a non-profit) – these identities are kept separate.

Workplace are working on solving the wider problem of identity, to be able to support people who aren’t sitting at a desk and/or don’t have a company email account, but need to re-gain access to their account. Under consideration are crowd-sourcing security (where your colleagues can confirm your identity so that your password can be reset). A less sophisticated idea is just to allow a manager authenticate their employee using the org chart – but that fails if the manager is unavailable. If you have a company admin, they could block an account when people leave the firm (caveat – confirmation by email that the person no longer has access).

Workplace highlight accounts at risk – Facebook check password dumps (websites that list passwords and accounts that have been compromised), so any matching accounts on Workplace can be notified that the account is at risk. In that case, they advise the user to reset their password (and educate them on the danger of re-using passwords across websites).

Spam Prevention – spam is in the eye of the beholder, the poster may think that a post is useful, but maybe the receiver doesn’t. Some tools exist in Facebook to prevent this – e.g. you can’t invite too many friends to an event. But for Workplace, those limits may not make sense – some global distribution lists are appropriate, such as for firm-wide announcements. Spam limits need to be context dependent – the company may want aggressive/lenient levels for spam filtering. During Hurricane Irma, one firm was posting regularly on Workplace and breached the spam limits, so these needed to be quickly adjusted.

Astha Agarwal & Connor Treacy – Building for the Workplace Platform

Initially, the application was called Facebook at Work – this was widely seen as a bad idea since Facebook was thought of as “not allowed at work”, so when re-launched it became Workplace. The Platform allows customer integration software/bots to be written. There are APIs for user management and group/content management. Bots can plug other tools into the Platform for chat and groups, to power everyday tasks. For example, discussions can be converted into tasks using a bot. They have also created an Interview Bot – to give useful reminders and context for interviews. 3000 companies are already using software integrations into Workplace. Another example is a bot to create groups for flight crews so that they can coordinate last minute changes.

Bots are built on top of the Facebook graph API, and bots in chat are very similar to bots for messenger. This enables developers to move from one codebase to another quickly. Many features are carried over, like quick replies (Yes/No), persistent menus and localisation (to translate bots into different languages).

Bots can act as a person in a group – so bots can like, comment and post. The bot can mention a person in a post so that they get a ping to look at the post. This was demonstrated for a bot that files issues in the bug tracking system when it is mentioned, and pings back to the issue creator to give them the ticket number.

Blaise DiPersia & Lyndsay Watt – Learning to Ship Love

Like any software team, Facebook have to balance Time to Market with Quality of Execution. Facebook’s Values inform their decision making – be bold, create social value, move fast and break things. This approach was initially good because they released exciting new features – but also disoriented some users and sometimes made the infrastructure unstable. Eventually there was a breakdown in user trust and a rift in company unity (between customer support and developers on new features). So “moving fast” was changed to “Shipping Love”, to encompass the delivery and quality together.

Now, tasks are evaluated against Value, Ease of Use and Craft – prioritised in that order (note that the different applications within Facebook such as WhatsApp and Instagram have slightly different emphasis on each of these).

Valuable – does it solve a real problem for a person, in a unique way
Easy to use – core features are easy to find, less common features still discoverable.
Craft – moments of delight and magic, handle failures and edge cases gracefully

Facebook Reactions was a good example of this philosophy. First, it had to be confirmed as a real problem that people wanted to be solved, tested in user focus groups. The team analysed which sticker emojis were used and how many comments were already single phrases. Reactions met all the requirements – value, easy to use and well-crafted – and is one of the most popular new features.

Leave a comment

Filed under Meetup

Book Review: The Hard Way, Lee Child

In a recent interview on BBC Radio 4, Lee Child was asked why Jack Reacher gets into so many tricky situations. The answer was simple – he keeps to himself pretty much all of the time, but a couple of times a year, trouble comes his way and he can’t leave it alone. Child has had no luck selling the idea of Reacher sitting drinking coffee all day to a publisher – so only the exceptional days get told in his books.

This book starts with Reacher drinking coffee in New York, minding his own business. A short time later, he’s in a swanky apartment helping to investigate the kidnap of a man’s wife and daughter. The first 24 hours are vital to the hunt – and Reacher is a witness who can help track down the mercenaries who took them.

Quickly, though, we find that all is not as it seems. The husband searching for his family is himself a shady character; a mysterious woman in an apartment opposite is keenly watching the comings/goings from the flat; the ransom demands jump up in multiples of millions, yet are paid in cash with little thought. As ever, it’s the details that matter – Jack Reacher misses little and is on hand to exact appropriate retribution.
Four stars

Leave a comment

Filed under Book Review