A quick question: What are the most beautiful programming books that you’ve ever read? The type of book that, when you cracked it open, made you just want to stare at the code forever. (Beautiful, non-programming but still technical, books are also acceptable.)
On a related note: What’s the best code formatting that you’ve ever seen? (Color, font face, font size, etc.)
These questions may, or may not be, related to this.
Currently, my favorite for “most beautiful programming book” would have to be “Processing: A Programming Handbook for Visual Designers and Artists“. The code is elegantly written, is crisp, and tightly spaced. I wish the code, itself, could’ve been printed in color, with syntax highlighting, but that seems like a necessary sacrifice to make with most technical books. (Side note: I’m a huge sucker for hardcover programming books – I desire more of them since having acquired this one.)
“Most beautiful technical book” would have to be Tufte’s The Visual Display of Quantitative Information. I love the stark contrast of the, simple, diagrams against the smooth text. I’ve you’ve never held a Tufte book, then you don’t know what a beautiful book can look like.
My favorite syntax highlighting scheme would be Gruber Dark, by the always excellent John Gruber.
However, Gruber Dark generally isn’t acceptable for print (nor is it particularly situated for code – I have to bash it around a bit to get something that I like). Unfortunately, I don’t have a particularly memorable light syntax-highlighting scheme; input here would be most appreciated.
Bonus: I’m in love with the Shoes programming guide Nobody Knows Shoes. _why’s sheer zaniness, whimsy, and deep programming knowledge is exactly what the programming world needs. If there were more books like his (see also: Why’s (Poignant) Guide to Ruby) the programming movement would be in a better place.
I’m completely convinced that programming has a strong symbiosis with art and that the two are entirely intertwined. I’ve been constantly exploring to try to get to the root of this relationship but, like most things, it’s a never-ending inspection. Pointers to the roadsigns are appreciated.
Bill Mill (December 28, 2007 at 7:06 pm)
I really liked the typesetting in Code Reading, it never got in my way in a book full of code examples. I also enjoyed the diagrams in Petzold’s Code. (Those weren’t available on Google Books so I had to steal a random page from Amazon.com; there’s definitely much better diagrams in the book.)
John Resig (December 28, 2007 at 7:12 pm)
@Bill: Those are great. I love the examples from Code Reading. Using the different grayscale colors to offset blocks of code (and annotating the with callout comments) is genius. I’ve gotta start experimenting with that.
The diagrams and typeface in Code remind me of Tufte’s work. It’s unfortunate that there aren’t more examples online. Although, it’s cheap, I’ll probably just pick up a copy to examine it more.
Anup (December 28, 2007 at 8:18 pm)
Don’t know how this falls into the beautiful category, but I found head first design patterns to be really good — although it was some 650 pages, I read it all in 8 hours, it was that compelling. It wasn’t just the aesthetics being beautiful (code examples were simple courier font, for example), but it was the mixture of a variety of techniques that made it not just a quick read, but a memorable one too. (That previous link is my summary/quick review of it, if it helps.)
Dean Edwards (December 28, 2007 at 8:37 pm)
I never read books about programming. In the internet age, I wonder why people still do…
Aaron White (December 28, 2007 at 8:43 pm)
I’ve seen that when people use animation software, it’s great for them to get their creative urge out, but many keep coming back because they love the abstraction challenge of “how can I make the animation work in some way?” Animation models can be very much like an operation tree that gets evaluated relative to time, so it can involve problem solving for more advanced animations…
I think art like programming is a lot about solving w/ constraints: for artists its about mediums, for coders it is about apis, efficiency, maintainability
John Resig (December 28, 2007 at 8:51 pm)
@Anup: Interesting example – I definitely recognize that signature Kathy Sierra style. I might have to pick that one up as well, I bet it would be useful if I were to ever get back into pure Java coding.
@Dean: By far, books are still the best resources for actual educational content. For example, let’s say you wanted to learn jQuery, Prototype, or even Processing? While their online documentation and tutorials are respectable, the books are considerably better; they are well written and structurally sound (an editorial staff, plus funding, has a way of doing that).
Now, you and I, probably have very little need for JavaScript books (they lag too far behind of what we’re interested in) – but we are, by far, the exception when it comes to developers. While there are some scattered resources on the web to learn things like closures, protypal inheritance, and other arcane facts – there are still no good universal web resources that solve that need. Because books can be funded, have an editorial staff, and go through numerous assurances for quality, they are, by far, the superior resource to turn to, in the end.
@Aaron: Great points, I highly agree that the similarities in constraints that both professions embrace is a unifying factor. I wonder if that’s what draws artists to programming or programmers to art via mediums like Processing.
Anup (December 28, 2007 at 9:43 pm)
“I bet it would be useful if I were to ever get back into pure Java coding.” … or C#, PHP, or any other OOP, although Java is the language used for demonstration :)
Eivind Uggedal (December 28, 2007 at 9:52 pm)
The most beautiful syntax highlighting scheme I’ve come by is Vibrant Ink by Justin Palmer.
Karl Swedberg (December 28, 2007 at 10:29 pm)
Well, this book might not be a fair candidate, because it’s more about design than it is about programming, but Andy Clarke’s Transcending CSS is gorgeous — beautiful color photography, strong graphical elements, high-quality paper, terrific 9″x9″ (approx.) shape. The book’s publisher, New Riders, seems to pay careful attention to design in a lot of their books.
Kevin Marks (December 28, 2007 at 10:54 pm)
Wolfram’s A New Kind of Science is remarkably beautiful, and also he never uses figure numbers as references, instead solving the layout problems so that all the illustrative diagrams and images are inline in the text in the right place.
Eddie Welker (December 28, 2007 at 11:31 pm)
I have to disagree with Head First Design Patterns. I’ve tried to read through it, only to be derailed specifically by the mix of styles. It’s too scattered. It’s rare to see award winning designs with a mis-mash of styles. Clean and simple is almost always better.
While not outwardly beautiful, I am a huge fan of the typesetting in The Little Schemer. The most amazing part is the way it intersperses code within dialog. You can work through the entire book without being confused between the dialog and the code. Additionally, the book has short readable lines (hitting that 8-12 word per line “ideal” right on the head), and makes effective use of whitespace. The horizontal rules seem a bit much to start, but are really quite effective, as are the drawings that open each chapter and grace the cover. All parts work quite nicely towards the whole. The only part that disappoints me is the small about of margin space on the page… Fermat would have no place to write!
John Resig (December 29, 2007 at 12:14 am)
@Eivind: Thanks for the pointer, another great dark-color-scheme highlighting.
@Karl: Interesting, well, I assume that they show CSS in the book (that’s “code”, no?). I’ll have to check into that one, as well.
@Kevin: That’s very interesting – I’d like to see how that’s done. I know that there were a number of times in my book that I needed to cite things in previous (or upcoming) chapters and having the figure/code block numbers helped tremendously.
@Eddie: I just snagged my roommate’s copy of The Little Schemer off the shelf and I have to agree wrt the text spacing and interspersing. You can always smell something that was typeset with LaTeX. I’m starting to find a common theme amongst some good programming books: Multiple columns. It seems to give extra flow and clarity and allow the author to have more control over the main content. I’ll have to ponder this some more, but I like the direction it’s heading.
Sean McBride (December 29, 2007 at 1:13 am)
I have REALLY been enjoying the Processing book as well. I really like their idea of sketching artistic ideas using code. It’s a fun challenge to write something short in Processing, predict what it will look like, and then see if you were right. I’m definitely not right all of the time.
Chris Hubick (December 29, 2007 at 1:46 am)
I’m surprised nobody has mentioned “Programming Pearls” by Jon Bentley:
http://www.cs.bell-labs.com/cm/cs/pearls/
Eddie Welker (December 29, 2007 at 4:42 am)
@John: Agree that multiple columns give the author more control, and that they can be leveraged to support the content in powerful ways. I think the primary benefit, however, is that they make the content more readable. Good typography makes what you read easier to comprehend. The less time I subconsciously think about typography, the more time I can devote to subject matter.
If interested, you should take a look at the “Typographic Bible” (Robert Bringhurst’s The Elements of Typographic Style… a truly beautiful book!), primarily at the second section on Horizontal Motion. It explains the mathematic rational behind line lengths, and I would expect the LaTeX people based their default settings on rules such as these. Newspapers have been applying these time-tested rules to their print versions for hundreds of years. (It’s too bad many don’t bother to apply the same rules to their current digital versions.) The principles in the book truly differentiate professional material from everything else.
I think you’ve convinced me to take a look at the Processing book, despite resisting it up until now.
Bill (December 29, 2007 at 4:49 am)
Why’s Poignant Guide to Ruby, yes. Also Practical Common Lisp opened up a new world for me. A Lisp book for the artist/engineer rather than the computer scientist. Maybe it’s not super-beautiful, but it’s certainly very well typeset and very practical.
http://www.gigamonkeys.com/book/
Jörn Zaefferer (December 29, 2007 at 8:52 am)
The last sort-of technical book that I had to read almost at once was Alan Cooper’s The Inmates Are Running The Asylum. There’s hardly any code, but he makes great use of small graphics.
Jamie (December 29, 2007 at 9:49 am)
I couldn’t agree more. For a long time I have held the belief that the best programmers are not science purists but versatile individuals that appreciate beauty and creativity – like you, I’ve never been able to fully rationalize these thoughts. It certainly has something to do with the simple beauty and elegance that typed code can exhibit when displayed on the screen or printed page. However I also believe that a good programmer is something of an artist – thinking in the abstract, using multiple simple structures to achieve a complex result, fighting dogma, that sort of thing. Maybe it’s just arrogance :-)
Thanks for the post – an enjoyable read.
Les (December 29, 2007 at 10:05 am)
Knuth: Art of Computer Programming
– http://www.amazon.com/Art-Computer-Programming-Volumes-Boxed/dp/0201485419
– http://www-cs-faculty.stanford.edu/~knuth/
Bohdan Ganicky (December 29, 2007 at 1:01 pm)
I have to second Karl. Clarke’s Transcending CSS is by far the most beautiful technical book I own. Not only it looks great but the content is outstanding as well.
William from Lagos (December 29, 2007 at 5:07 pm)
Hey John
I just got a copy of your book and I think it’s cool too.
how come it didn’t make your list?
Gavin Brogan (December 29, 2007 at 6:19 pm)
Just got Dustin’s new book and it seems to be hitting the mark so far
JS (December 30, 2007 at 12:31 am)
“I’m completely convinced that programming has a strong symbiosis with art and that the two are entirely intertwined. I’ve been constantly exploring to try to get to the root of this relationship but, like most things, it’s a never-ending inspection. Pointers to the roadsigns are appreciated.”
Might I direct you towards the little book titled ‘Hackers and Painters’ by author Paul Graham.
Michael Williams (December 30, 2007 at 7:32 am)
The essay Hackers and Painters, which appears in the book of the same name, is certainly worth reading, but you should also check out Maciej CegÅ‚owski’s response.
Miguel Ventura (December 30, 2007 at 9:05 am)
Dark background for code is great when programming but its rather bad for reading on paper. Some years ago I got stuck with the listings package for LaTeX and have since used it for every code I had to write on reports so I guess you should give it a try too :)
The definitions I’ve been using are something like
\lstinputlisting[%
language={c++},
breaklines=true,%
basicstyle=\small\ttfamily,%
tabsize=4,%
keywordstyle=\color{blue},%
commentstyle=\color{green},%
stringstyle=,%
showstringspaces=false,
numberstyle=\tiny,
numbers=left,
identifierstyle=%
]{my code filename}%
As for a concrete definition of font-face, font-size, I’m afraid I really don’t know what does LaTeX choose for ‘small’, ‘tiny’ and ‘ttfamily’…
Hossein (December 30, 2007 at 5:52 pm)
Hey John
Nice to meet you man. It’s realy nice job.
manu (December 31, 2007 at 5:04 am)
“I’ve been constantly exploring to try to get to the root of this relationship”
maybe you should leaf through GEB :
http://en.wikipedia.org/wiki/Gödel,_Escher,_Bach
Oscar Sanchez Casamitjana (December 31, 2007 at 8:21 am)
@John: The predecessor for the P55 book is “Design by Numbers” a beautiful (hardcover) book by John Maeda: http://books.google.com/books?id=cptXSf5kS_IC
Tuftian aesthetics but with a mechanical twist :)
Travis (December 31, 2007 at 4:11 pm)
The Zen of CSS is the most beautiful programming-ish book I’ve ever read. Since it just deals with mark-up and style I can’t really consider it programming, but it does have code in it.
http://www.amazon.com/exec/obidos/ASIN/0321303474/
Saudade (December 31, 2007 at 7:41 pm)
Concepts, Techniques, and Models of Computer Programming
Very beautiful, and the ideas inside… mmm
Jorge Diaz Tambley (December 31, 2007 at 8:00 pm)
I really liked the setting in Code Complete (versions 1 and 2) by Steve McConnell, also the content is a gem.
Saludos
pb (January 2, 2008 at 4:05 pm)
I had no idea there was a programming “movement”. Except after lunch I guess.
Jörn Zaefferer (January 2, 2008 at 5:11 pm)
An interesting post titled Software is merely a Performance Art .
Thomas (January 7, 2008 at 6:08 am)
Here are two of my all times favourites:
Clack/Myers/Poon: Programming with Miranda
One of the best programming books I ever touched, not in terms of typesetting, but in terms of intellectual presentation of the material (and that’s what a “beautiful” book is about, right?!).
Peek/O’Reilly/Loukides: Unix PowerTools
Don’t laugh! Maybe the grandparent of O’Reilly’s “Hacks” series, this book is a huge collection of short tips, tricks and hacks (in the good sense), which are “hyperlinked” – as far as this is possible on paper. I love the piecemeal granularity of the articles, which provide immediately applicable benefit and over time and in contrast to common expectation can lead to substantial knowledge. I wish more books would be like this (because, let’s face it, most books waste too much time on introduction and context). The first edition used blue for headings and emphasis to great advantage.
Leslie (February 6, 2008 at 3:03 pm)
My favorite technical books of late have been Glezer’s Artisan Baking, for the looks and narratives, and Hamelman’s Bread: A Baker’s Book of Techniques and Recipes, for the content and overall depth :)
Just imagine world-class (computational?) photography on computer code… more Matrix than The Net!
~L