Blag

He's not dead, he's resting

Tag Archives: books

The Visual Display of Quantitative Information

The Visual Display of Quantitative Information

The Visual Display of Quantitative Information

The Visual Display of Quantitative Information by Edward Tufte is a fairly peculiar book. Let’s start with what it’s not:

  • It’s not a book cataloguing different types of graphs and charts.
  • It’s not a book providing comprehensive coverage of any particular subject.
  • It’s not a book explaining the principles behind graphs and charts.
  • It’s not a book on statistics.
  • It’s not in any way technical.

So what is it then?

The best way I can describe it is as a printed museum of graphs and charts. It includes examples of historically important graphs, along with some specimens that are interesting for their design rather than what they convey. Unlike a museum, though, it also includes a fair number of bad examples, along with critical commentary and improved redesigns. The book is especially critical of the recent trend of designing graphs to look pretty rather than to convey information, and showcases some particularly deceptive graphs where the decoration leads to the graph showing an opposite trend to the data.

I probably didn’t directly learn very much from having read the book. That doesn’t detract from its value, however. The content was certainly interesting, and as a work of art it is highly impressive. Most of all, though, I strongly suspect that it will serve as inspiration for various things later on.

If you’re just looking to learn, this isn’t the book to get. But if you don’t need to know something specific, your mind will be better off for having read it.

How Round Is Your Circle?

As everyone knows, a point is that which has no part, a line is a breadthless length, and it is possible to cut a sphere up into a finite number of pieces, move them around and put them back together again to get two spheres identical in every way to the original sphere.

Unfortunately, in reality, points have a size, lines have a width, spheres aren’t spheres and they can’t be cut up into infinitely complicated pieces. How Round Is Your Circle, Where Engineering and Mathematics Meet by John Bryant and Chris Sangwin is an attempt by engineers to convince mathematicians that caring about real world issues can be interesting.

The book covers various practical issues, such as:

  • How to draw a straight line, and how to make a ruler
  • How to test how circular a circle is
  • How to measure area

In the process, it discusses all kinds of cunning gadgetry used in the olden days before digital computers and mass production, from steam engine linkages and pistons to slide rules and draughting devices. It also covers various physical demonstrations of geometric problems, and illustrates what happens when physical inaccuracies are ignored:

64 = 65

It’s certainly an interesting read, although I would have preferred more emphasis on the tools and gadgets used than on demonstrations of things they can be used to make. The maths isn’t particularly heavy, and shouldn’t put too many people off. Similarly, there’s nothing on the engineering side that would be inaccessible to anyone with no engineering background.

Fiction, Fiction, Television

  • Anathem, by Neal Stephenson. Rather good, although the ending looks suspiciously like it’s mocking all those misguided fools who say Stephenson can’t write endings.
  • House of Leaves, by Mark Z. Danielewski. 20% brilliance, 70% filler hidden behind novelty.
  • Dollhouse. Has potential. I give it ten episodes, by which point it will either be awesome and cancelled or lame and going on for another five years. I may change my mind next week.

Programming – Principles and Practice using C++

Programming — Principles and Practice Using C++ is the new book by Bjarne Stroustrup, the daddy of C++. It’s an introduction to programming rather than an advanced book; I’ve been holding off writing up my impressions of it because I’m not entirely sure what to say.

The overriding theme of this book seems to be “there are lots of complications, special cases and obscure things”. This is of course true, and it’s a refreshing change from most introductory books that go out of their way to construct highly contrived examples that conveniently ignore any obscurity. But I suspect it goes too far — pretty much every example is twice as long as it probably should be. There’s so much focus on dealing with complexities that the underlying “what’s going on?” is lost.

Partly this is down to C++. A language designed to handle real world, large scale problems and provide for maintainability over decades isn’t going to be the most elegant. On the other hand, purely teaching languages that dismiss the real world entirely are of no practical use. The question is whether C++ as a first language is a sensible idea, and I’m not in the least bit convinced that it is.

Partly, though, this is down to the choice of projects. An example: two chapters are devoted to writing a calculator program. These chapters cover lexers, parsers, grammars and error recovery. This isn’t one of those cop-out calculator programs where syntax is carefully selected to hide any kind of mess, either — it almost looks like the book is going to end up implementing a compiler… Unfortunately, there’s nothing in the final program that really needs any of this complexity; a simple “tokenise into a list, then replace all the multiplications with their result, then replace all the divisions with their result and so on” would work just as well for the requirements, and wouldn’t have most of the mess.

The scope of the book is impressive, though. It doesn’t gloss over classes, templates, pointers, exceptions or even dealing with code written in C. It’s extremely comprehensive, even in places where it probably shouldn’t be.

Finally, a note on writing style. The word ‘basically’ appears on average once per page, and sometimes three or four times in a single paragraph. This gets very annoying very quickly. Stroustrup’s other books don’t suffer from this.

I suppose my conclusion is: if you have to learn C++ as a first language, this is the book to use. If you have a choice, though, learn one of the monkey languages first, and then pick up The C++ Programming Language and The C++ Standard Library.

Bedtime Reading II

“Elements of Programming” and the ↦ symbol

I’m working my way through the draft of Elements of Programming. And I have a gripe. A small gripe, admittedly, but a gripe non-the-less.

The book uses a lot of symbols. I don’t have a problem with that, and in general it’s more readable that way than spelling everything out. Most of the symbols are defined in an Appendix as well, which is also good. But there is one that is not: the ↦ symbol (or in ascii art, |-->). Here’s an example of its use, taken from page 123:

Definition
abstraction(Op : BinaryOperation)
associative : Op → bool
    op ↦ (∀a, b, c ∈ Domain(op)) op(a, op(b, c)) = op(op(a, b), c)

Whilst the meaning is obvious, I can’t work out how the symbol is supposed to be read. I can’t find that symbol used in reference literature either. The best I can come up with is “Is such that”, but that’s rather clumsy…

Update: Looks like it’s “maps to”. Essentially the associative : line defines the type signature for the associative property, and the last line defines it in terms of a lambda. Looks like mathematicians came up with yet another way of defining functions that I managed to miss. Give me back my λ!

Bedtime Reading

The C++ Books List

The current “C++ books worth reading” list is as follows:

Learning

  • If you can already code, work your way through the next section in order. If you can’t, don’t learn C++ as your first language.

General reference

  • “The C++ Programming Language”, 3rd Ed, Bjarne Stroustrup.
  • “The C++ Standard Library: A Tutorial and Reference”, 1st Ed, Nicolai M. Josuttis.
  • “The C++ Standard Library Extensions: A Tutorial and Reference”, 1st Ed, Pete Becker. This covers TR1, which isn’t fully implemented in most compilers yet.
  • “C++ Templates: The Complete Guide”, 1st Ed, David Vandevoorde and Nicolai M. Josuttis.
  • “Standard C++ IO Streams and Locales: Advanced Programmers Guide and Reference”, 1st Ed, Angelika Langer, Klaus Kreft.

Using C++

  • “Effective C++: 55 Specific Ways to Improve Your Programs and Designs”, 3rd Ed, Scott Meyers.
  • “Effective STL: 50 Specific Ways to Improve Your Use of the Standard Template Library”, 1st Ed.
  • “More Effective C++: 35 New Ways to Improve Your Programs and Designs”, 1st Ed, Scott Meyers. Somewhat dated in parts.
  • “Modern C++ Design: Generic Programming and Design Patterns Applied”, 1st Ed, Andrei Alexandrescu. Note that using any technique mentioned in this book is liable to get you kicked in the face, but being aware of said techniques is useful.

Software Design

  • “Design Patterns: Elements of Reusable Object-Oriented Software”, 1st Ed, Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides. Better known as “Gang of Four”. Not C++ specific.
  • “Patterns of Enterprise Application Architecture”, 1st Ed, Martin Fowler.
  • “xUnit Test Patterns: Refactoring Test Code”, Gerard Meszaros.
  • “Patterns for Parallel Programming”, 1st Ed, Timothy G. Mattson, Beverly A. Sanders, Berna L. Massingill.

Behind the Scenes

  • “Inside the C++ Object Model”, 1st Ed., Stanley B. Lippman.
  • “The Design and Evolution of C++”, 1st Ed, Bjarne Stroustrup.

Unix

  • “Advanced Programming in the Unix Environment”, 2nd Ed, W. Richard Stevens, Stephen A. Rago. C, not C++.
  • “Linux System Programming”, 1st Ed, Robert Love. Again, C.

Algorithms and Tools

  • “Mastering Regular Expressions”, 3nd Ed, Jeffrey E. F. Friedl. No mention of C++.
  • “Synchronization Algorithms and Concurrent Programming”, 1st Ed, Gadi Taubenfeld.