Category Archives: Tech Book

Modern C++ in Embedded Systems

I was thinking about C++ for embedded environments recently and wondered how much of today’s Modern C++ was recommended for use. I found an excellent article by Dominic Herity on the subject:

  1. Modern C++ in Embedded Systems – part 1
  2. Modern C++ in Embedded Systems – part 2

Even better, Dominic linked to some presentation materials Scott has published electronically on the subject. I’ve long been a fan of Scott’s writing and wasn’t aware of this electronic book, so I’m reading that next.

Leave a comment

Filed under C++, Programming, Tech Book

Tech Book: Data Science from Scratch, Joel Grus

This book is an excellent primer on data science. It builds up concepts from scratch with code examples in Python. Whilst it uses some well-known libraries for utilities, the code that builds on the core Data Science concepts is all included and explained in the book.

I particularly enjoyed the conversational, often humorous style of the book. He gives a short introduction to NoSQL databases, then concludes: “Tomorrow’s flavour of the day might not even exist now, so I can’t do much more than let you know that NoSQL is a thing. So now you know. It’s a thing”. The author doesn’t get too stuck in jargon either – one example is his definition of a greedy algorithm: “… at each step, it chooses the most immediately best option” – perfect.

Some of the main topics covered are:

  • Visualizing Data
  • Gradient Descent
  • Linear Regression
  • Logistic Regression
  • Neural Networks

Having covered the theory, the book extends to a few use cases – natural language processing, network analysis and collaborative filtering.

Four stars

Leave a comment

Filed under Python, Tech Book

Tech Book: The Phoenix Project

This is a technical book, packaged as a very readable tale of an IT Manager who is promoted to Vice President of IT Operations across his company. Whilst Bill runs a tight ship in his small department, the company as a whole has a poor culture for delivering software. Bill is ordered by the CEO to do whatever it takes to bring the Phoenix Project (an IT re-vamp vital to the company’s business) to completion.

Much of the technical content concerns the DevOps arena and touches on issue tracking and prioritisation as well as improving time to delivery. It’s a good read as well as making some well-argued technical points.
Four stars

Leave a comment

Filed under Tech Book

Tech Book: Effective Java, 3rd Edition, Joshua Bloch

Effective Java, 3rd EditionI’ve just finished reading this technical book on Java. It’s widely recommended if you’re going to work on a Java codebase and provides best practice guidelines on:

  1. Creating and Destroying Objects
  2. Methods Common to all Objects (such as hashCode and toString)
  3. Classes and Interfaces
  4. Generics
  5. Enums and Annotations
  6. Lambdas and Streams
  7. Exceptions
  8. Concurrency
  9. Serialization

Although there isn’t the humour that I’d associate with the Scott Meyer’s Effective C++ series, I’ll definitely refer to this one in the future.

Java Fundamentals, Jim WilsonThis book isn’t the starting place for learning Java though (and doesn’t intend to be). For that, it’s worth turning to a more basic set of materials. I worked through a PluralSight course, Java Fundamentals.

Leave a comment

Filed under Java, Tech Book

Tech Book: Effective Python, Brett Slatkin

I’ve been learning Python for a few months and am starting to use it at work, so I thought it was about time to read a book about Python. This book has been excellent. No only does it follow format of the time-honoured ‘Effective’ series pioneered by Scott Meyers, it also features practical, useful code examples. In particular, his JsonMixin class was immediately relevant to some work I’ve been doing to generically serialise to/from JSON documents – see Item 26 “Use Multiple Inheritance Only for Mix-In Utility Classes”.

The author has also taken the time to record hours of video lessons for Safari Online subscribers, so you can view additional material as he works through the items in the book.

Leave a comment

Filed under Python, Tech Book

Tech Book: Algorithms in a Nutshell, Heineman, Pollice & Selkow

algorithmsinanutshellI really enjoyed reading this book, probably the best endorsement I can give for a technical book. The authors introduced the common computer science algorithms that you would expect in a good desktop reference, giving each a block of pseudo code, some analysis of algorithmic complexity and implementation trade-offs, and finally a proper implementation in a standard programming language (usually Java). The later chapters cover slightly more advanced techniques, typically with a practical example. My favourite was their randomised algorithm for estimating a solution to the famous “n-queens” problem (developed by Knuth in 1975).
Five Stars

Leave a comment

Filed under Tech Book

Tech Book: Effective Modern C++, Scott Meyers

EffectiveModernC++When Scott Meyers announced his retirement from C++ duties, I thought I’d get a copy of his latest book. There’s plenty in it to interest even seasoned C++ developers – as always, Scott’s insight and in-depth examples are worth studying. I’ve tried out most of the C++11 features, but still learnt a lot working through this book.

Uniform Initialisation and Auto
Meyers points out that compared to parentheses or just plain “=”, braced initialisation can be used in the most contexts, avoids his famous “C++’s most vexing parse”, and will issue compiler errors if narrowing occurs. However, for types that can take a std::initialiser_list in their constructor, the compiler is required to favour std::initialiser_list over any other interpretation. That’s a deterrent to use of braced initialisation with types that have a std::initializer_list constructor – and also precludes using auto with braced initialisation.

auto x = { 4 }; // type of x is inferred to be std::initializer_list<int>!

How to use the new “= delete” idiom
Meyers recommends declaring deleted methods as public to get better error messages from compilers that check for accessibility before deleted status. He also points out that you can declare non-member functions as deleted (I’d only seen examples of copy-constructor/copy-assignment operator as deleted before).

Use of noexcept on move operations
This one is a classic example of a combination of language features having an unexpected effect. std::vector::push_back offers the strong exception guarantee. It can achieve this using any copy constructor and being sure not to change the original contents of the vector until any new elements or copies have been constructed. Hence, move constructors are only preferred if it is exception-safe to do so – which means they must be marked as noexcept (and if that isn’t appropriate, you just won’t get move semantics pushing instances of your type into a std::vector).

Recursion with constexpr
Having toyed with template meta-programming in the past, this use of constexpr appeals to me:

constexpr int pow( int b, int exp ) noexcept
{
    return (exp == 0 ? 1 : b * pow( b, exp-1 ));
}
constexpr auto eight = pow( 2, 3 );

void testConstExpr()
{
    std::cout << "2^3 = " << eight << "\n";
}

It’s much more succinct than the equivalent TMP version, and still performs the calculation at compile time.

Summary
In the past, I’ve recommended Effective C++ for developers who have little experience of the language and wish to improve their skills. I think this book is a bit too advanced for that, particularly given the chapters on template type deduction and decltype being in the first part of the book! So read this book if you’ve got a few years’ experience of C++ already, but look at Effective C++ (3rd Edition) to improve on the basics.

Four stars

Leave a comment

Filed under C++, C++ Code, Programming, Tech Book

Tech Book: Swift for the Really Impatient, Matt Henderson & Dave Wood

SI love the title of this book, the authors kept the content as concise as possible and showed that it really is possible to give a decent introduction to a programming language in just 156 pages (and less than 1cm). The book is quite practical you can read it cover-to-cover to pick up the features of the language, then you can use the handy code snippets as a quick reference guide (and the index is pretty good for this too, not always the case).

I bought a 2015 edition, the only downside being that this seems to be aimed at Xcode 6 and is now slightly out of date. With Swift being an evolving language, that’s to be expected – some readers might prefer to work with the electronic copy and remain up to date.

It’s also worth mentioning that, if your aim is to write a simple iOS app in Swift, you might be better off working through a tutorial and learning Swift that way, along with picking up tips and tricks for working with Xcode. See FoodTracker and To Do.
Five Stars

Leave a comment

Filed under Programming, Swift, Tech Book

Tech Book: 9 Algorithms that Changed the Future, John MacCormick

AlgorithmsThatChangedTheFutureThis excellent book introduces algorithms that are heavily used in daily life, yet are unknown to the general public. The author aims to introduce them without requiring advanced knowledge:

I assumed that the great algorithms would fall into two catagories. The first category would be algorithms with some simple yet clever trick at their core – a trick that could be explained without requiring any technical knowledge. The second category would be algorithms that depended so intimately on advanced computer science … Imagine my surprise and delight when I discovered that all the chosen algorithms fell into the second category!

The book is a fun read and despite knowing some of the details already, it helped to build my appreciation of the algorithms and their applications.

The algorithms covered are:

  • Search engine indexing
  • PageRank
  • Public key cryptography
  • Error-correcting codes
  • Pattern recognition
  • Data compression
  • Databases – reliability and consistency
  • Digital signatures

There’s also an excellent chapter on unsolvable problems, with a nod to Alan Turing.
20141005-142632.jpg

Leave a comment

Filed under Tech Book

Tech Book: Seven Databases in Seven Weeks

Seven Databases in Seven Weeks – a guide to modern databases and the nosql movement
I picked this book to learn about NOSQL which seems to be a current buzzword. I have experience writing SQL-based applications with Watcom and SQL Server, but the new database back-end choices are impressive and have neat ideas that can be generalised for other applications (e.g. resilience).

Leave a comment

Filed under Tech Book