Blog Archives

← 2004 
Months
Nov

Links

Kevin
Charles
Thatcher
Aaron
Ryan
Ignacio

Large-Scale C++ Software Design: John Lakos

Nick Wheeler, one of my favorite professors, liked to say that the best books about physics and mathematics were "short works by masters." Ideally, a book should be about a big idea, written by someone with a virtuoso's grasp of the subject and the talent to pare it down to its simplest form. This is a huge book about a medium-sized idea.

To be fair, this book plugs a gap in the literature on software design. When you read, say, Booch or Meyers, when they say "design", they mean exclusively logical design. They're entirely concerned with the relationships between the modules and classes you're working with. This book is the only one I know of that comprehensively deals with physical design: how those classes are physically laid out in source files, and the consequences for development efficiency. Anyone who has ever spent 5 hours of an 8 hour day actually programming, and the other 3 hours waiting for the program to compile knows that those consequences can be huge.

Unfortunately Lakos spends endless pages devoted to subjects that anyone who's ever written code for a living should either a) already know or b) instantly grasp in a sentence or two. At 800+ pages, the only non-reference books on my shelf that compare to it in length are McConnell's phone books and the three volumes of Knuth. If we were to assign elements to these to indicate information density, Lakos is lithium, McConnell iron, and Knuth is somewhere in the transuranic portion of the periodic table. As such, the book is probably best suited for someone who has done plenty of coding, but needs to work on their discipline a little bit, i.e. students taking their first professional job.

Luckily, the author has provided an out. If you turn to page 815 (!), you will find in Appendix D a list of all of the aphorism, principles, and tips from the main text. It's like a list of koans that distill the entire book down to a manageable length. If you squint at these 17 pages just right, this is a small book by a master. I promise you, reading these will give you 80+% of the value of the entire book. There are page references with each tip in case the meaning isn't instantly apparent.

Recommended if you are about to begin working on your first large software project, or if the compiles on your current project are taking more time than it takes to get to Starbucks and back. Make sure to buy a used copy though, Powell's will frequently have them in stock.

Prime Obsession: John Derbyshire

I can say with confidence that this is the most interesting book for laymen about the Riemann Hypothesis ever written. Derbyshire has written a book that is roughly equal parts Men of Mathematics and introductory number theory. Since he's pitching at a general audience, the introduction to the complex plane and calculus can drag a bit if you've encountered them before, but eventually he's sketching results that you're not likely to have encountered unless you've taken analysis or number theory courses at an undergraduate level. The result is an extremely approachable introduction to the most famous outstanding problem in mathematics.

One area where I felt the book could have done better was in the annotations. As an example, on page 259, Derbyshire refers to two theorems that allow the number of zeta function zeros in the critical strip between two heights to be compared to the number of zeros on the critical line. This is a key component in verifying that there are no violations of the Hypothesis up to a given height above the real number line. It wouldn't be appropriate to his main text to give a detailed explanation, but even in the footnote for the section, he refers to the theorems only as "Theorem A" and "Theorem B". A Mathworld link or some other more detailed reference would have been ideal here.

At 350+ pages, Prime Obsession will keep you tied up for a while. I'd recommend it if you recognize at least 3 of the following 4 names: Euler, Ramanujan, Russell, Hilbert. You will really enjoy the book if you know what an Erdős number is, but don't have one. You will certainly be bored by it if you have an Erdős number less than 4.

Sneaking in Bad Legislation

The lame duck Senate might try to sneak through a really nasty Copyright bill before this session expires. (Really, before the excerable Orrin Hatch's chairmanship of the Senate Judiciary committee expires.) This bill would do wonderful things like make it illegal to tape a movie from broadcast TV, and edit out the commercials for later viewing. Lovely. Since I'm in California, writing my senators (Boxer and Feinstein), has roughly zero chance of influencing their views or votes, but what the hey.

Senator [Feinstein|Boxer],

I am writing to you today to urge you to vote "no" on HR.2391, the CREATE Act, if it comes to a vote in the Senate. This bill further unbalances an already badly skewed copyright regime.

In addition, I urge you to adjust your position on such intellectual property matters. As a constituent, I note that you allowed the Digital Millenium Copyright Act, a similarly flawed piece of legislation to pass without registering an objection. That bill has created barriers to innovation in the the technology industry, but has created only small inconveniences in the everyday life of consumers. HR.2391, and upcoming regulatory changes such as the "Broadcast Flag" will have a far greater impact on everyday life. It is not likely that such legislation will go unnoticed as it has in the past when Tivos and VCRs start to lose functionality that upsets the MPAA or the RIAA.

Dave Moore

To see why these letters have no shot, check out the excellent opensecrets.org website. In particular: Boxer, top contributers (Time-Warner, Viacom, Sony, Disney, and Vivendi) and top catagories. Feinstein, top contributers (Disney, Time-Warner, and Vivendi) and top catagories.

These numbers are for Boxer's 2004 race, and Feinstein's 2000 race. It's extremely frustrating to me that I can't find candidates to vote for in this area that aren't completely in the pocket of the movie and music industry.

Fun with CSS

New design for the site, whee! Most of the design I ripped off from various entries in the css Zen Garden database. Most notably, the bulk of the CSS for the site came from Ben Nolan's Utilitarian entry. Most of the layout is cribbed from Nelson Minar's excellent blog.

The site also validates as XHTML 1.0 Strict and CSS again. I'm sure that will come in handy. For fun, you can see what the site looks like with all of the CSS turned off here.

Hm. There are some problems with IE, apparently. Fun. Ok, that's fixed. Standards compliant browser my ass.

Finally

Commercial CG that doesn't make me wish that computers were vastly more expensive! The latest TV spots in the HP Invent ad series are really sharp. (Click, Click.) The CG doesn't get in the way, and they obviously spent a lot of time and thought to make it convey the message that it's effortless to make and manipulate digital images with HP products.

Another bit of CG that I really liked recently was the What Barry Says propaganda short that's been popping up in various places. The visual aesthetic is great, but I most admire the way the transitions play with constructs that only parse correctly from one viewpoint, creating a flowing visual that doesn't jar the viewer despite radical changes in scope and subject. (n.b. the audio track is a little Black Helicopter, turn it down, it won't detract from the visual.)

It's particularly nice to see CG coming out that takes advantage of this "limitation" of computer rendering to create effects that would not be possible if the image were truly 3-dimensional. If the Barry viewpoint tricks were presented as a proper pair of stereo images, you would spot the wires right away. This is the same technique Escher used to make his famous images that fiddled with perspective; taking advantage of the fact that a 2d projection of a 3d scene causes several points in 3-space to collapse to the same point in the picture plane. Since this stuff is my stock-in-trade, I really like it.

Non-geeks stop reading here
As a pedantic aside, it would be possible to recontruct some the HP ads if we were rendering stereo pairs, but only for the effects in which the actor drapes the picture frames over his head. You would have to replace the texture that you had been rendering to the frame with the pixel for his face at the exact moment that the point on his face intersected the texture plane. The images that you'd have to use for textures wouldn't be nearly as neat and tidy, however, since the frame and his face are in motion. It would have to be all stretched and smeared, as if you'd moved a piece of paper in the middle of a photocopy. The effects in which the piece of paper "snaps" an image while held in front of his face would be impossible to make seamless unless you make the assumption that the viewpoint is infinitely far away, in which case your stereo pairs collapse to the same image.

Small bug fix

Small update uploaded for perforce_rss to fix a bug in the GMT date calculation. Also adds a new parameter for the output location of the tempfiles used in creating the feed document.