LJ Archive

At the Forge

2012 Book Roundup

Reuven M. Lerner

Issue #224, December 2012

What has Reuven been reading? And, what should you be reading? It's time to review this year's crop of technical books.

Once again, I'm dedicating my December 2012 column to a review of the latest books (and other resources) that I've found interesting, useful or just entertaining during the past year.

It continues to amaze me that despite the state of the global economy in general, and of publishing in particular, we continue to enjoy a large number of high-quality technology-related books each year. A growing number of these books are being produced as e-books, rather than printed copies, and many of them are being produced by independent authors and small publishers, rather than the more-established names in the publishing business. By paying attention to blogs, forums and technology podcasts, you can learn about these independent publications, which often are both low in price and high in quality. (Of course, there also are some for which I've paid that turned out to be not nearly as good as I had hoped.)

Ruby

I spend a large part of my time developing software (as opposed to consulting or training); thus, I'm always interested in improving my techniques, learning more about the technologies I use on a day-to-day basis and incorporating the latest ideas into my work. My first-choice programming language continues to be Ruby, along with the Ruby on Rails framework. For that reason, I'm happy to see that the number of resources for Ruby programmers continues to grow. Once again, The Pragmatic Programmers have led the way with a good number of Ruby-related titles.

Several years ago, The Pragmatic Programmers came out with a book called Rails Recipes, which contained all sorts of interesting, bite-size ideas, suggestions and practical solutions for Rails developers. This year, The Pragmatic Programmers released Rails Recipes: Rails 3 Edition, which brings the book into the modern era of Rails development. Some of the topics are simple or are well documented elsewhere, such as setting a site's home page, model versioning and sending e-mail with attachments. Other topics were, I thought, descriptions of features that I hadn't seen elsewhere, such as custom collection methods to ActiveRecord results and use of composed_of. This book is useful for Rails developers of all levels.

One of the biggest knocks against Ruby is its relatively slow execution speed, and a second issue is the lack of serious threading. Both of these problems are largely eliminated if you use JRuby, an implementation of Ruby that uses JVM bytecodes. I haven't personally used JRuby on very many projects, but there have been times when I have needed or wanted to do so—and quite frankly, although programming with JRuby isn't very different from the standard Ruby 1.9 interpreter, deploying is another story altogether. I haven't worked with Java on a day-to-day basis for many years, so the array of files, configurations and systems needed to take a JRuby program and make it available to the world is a bit confusing for me.

Fortunately, the book Deploying with JRuby, by Joe Kutner and published by The Pragmatic Programmers, aims to fill this gap. It walks you through the steps necessary to deploy a JRuby application (including Rails applications written in JRuby). The book makes many assumptions regarding how you want to deploy your server, using a virtualized environment and Amazon's EC2. However, this is a common enough pattern that I can understand the reasons for pointing people in this direction, rather than individually configured servers.

Finally, the book Crafting Rails Applications, written by Jose Valim and also published by The Pragmatic Programmers, is a rare book aimed at advanced Rails developers. I still haven't gone through it entirely, but Valim presents a number of projects and programs in this book, each of which exercises a different area of Rails that I didn't personally feel like I understood well enough—for example, the “Metal” interface for controllers. Even if I don't use the knowledge gained from this book immediately, my deeper understanding of Rails and how it works undoubtedly will be beneficial in my work, helping me to debug existing applications and structure new ones.

JavaScript

Even the most die-hard Rails developer needs to know at least one other language, namely JavaScript. JavaScript is, by some accounts, the most widely deployed programming environment in the world, given the incredibly large number of browsers that ship with it, on computers of all shapes, sizes and makes. I still have issues with the JavaScript language, but there's no avoiding its use in the modern Web era, and there are many add-ons and frameworks that make its use more palatable.

I was pleasantly surprised to see that O'Reilly has released a new version of David Flanagan's classic book, JavaScript: The Definitive Reference. I have had a copy, physical or virtual, of this book on my shelf since its first edition was released, and although the physical book has become almost unmanageably large at more than 1,000 pages, the content continues to be useful. The book has been updated to include some of the latest trends and libraries in the JavaScript world, including jQuery, HTML5 (including such items as client-side storage and Web sockets) and node.js. It's nice to know that I can continue to rely on Flanagan's clear writing to teach (and just remind) me of aspects of JavaScript that I need to know.

I often tell students in my classes that the problem with programming today is not the development, but rather the maintenance. JavaScript, with its extremely loose structure and lack of built-in systems for modular code, makes it even easier for problems to occur. Thus, I was happy to see the book Maintainable JavaScript, written by Nicholas C. Zakas and published by O'Reilly. Many of the things that Zakas writes are obvious to experienced JavaScript programmers, such as the fact that you can use either single or double quotation marks to define strings.

What is more useful and impressive is his collection of facts about style guides and the implications of your choices—contrasting, for example, the jQuery style guide (which prefers double quotation marks) and the Google style guide (which suggests single quotation marks). I wish this book had included a mention of CommonJS, which offers a standardized system for modularizing and deploying JavaScript, an important aspect of maintainable code. I also see this book as complementary to Crockford's small but excellent book, JavaScript: The Good Parts, which was released a few years ago but still contains very useful information.

A new series written by Rails-veteran Noel Rappin and independently published at his site (www.noelrappin.com) attempts to introduce developers to JavaScript development, including the use of Backbone, CoffeeScript and test-first development (TDD). The series isn't complete as I write this, but I've enjoyed the parts I have read, and I definitely have learned from it. I look forward to the completion of part 3 and to the forthcoming part 4 as well.

Although I used to laugh at the idea of server-side JavaScript, node.js clearly has become a force to be considered in the server-side world. I'm still not convinced that the node.js paradigm is one that is appropriate for all sites, but there's no doubt that having a single language in the browser and the server can be useful, and that the speed with which server-side JavaScript executes is impressive. O'Reilly's new Learning Node, written by Shelley Powers, is a gentle introduction to node.js for people who already know JavaScript, but who haven't yet used it with a server.

Powers covers the basics of installation, moves onto common patterns and paradigms of working with node.js, and then introduces a number of topics that should be familiar to all Web developers, from application frameworks (Express) and templating systems (EJS), to relational and non-relational databases, to testing and SSL. As node.js grows in popularity, it's probably a good idea for all Web developers to gain at least some familiarity with it, and this book provides a great way to gain some experience.

Other Languages

Although it's not quite a language, HTML5 has become quite the superstar in the Web world—and for good reason, as I have discussed in many columns to date. HTML5, although imperfect and still far from being universally delivered, offers the tantalizing prospect of full-fledged applications running inside our browsers. If you're still trying to make sense of the many HTML5 features and how they fit together with your favorite JavaScript library, you should take a look at O'Reilly's Programming HTML5 Applications, written by Zach Kessin.

Kessin, like many HTML5 authors before him, discusses a number of HTML5-related technologies, each in its own chapter. So if you want to understand how to work with files, local storage, Web workers or even Web sockets, you won't be surprised to find a chapter on each of those topics. What I found refreshing in this book was the attention to testing the JavaScript portion of HTML5 applications using QUnit and Selenium. The book also looks at how each of these HTML5 features works with existing JavaScript frameworks, so that jQuery and extJS users will understand what they need to do, or what the framework provides, to ensure smooth usage.

If you already are familiar with HTML5, but (like me) still are learning how to work with mobile devices, O'Reilly's Head First Mobile Web, written by Lyza Danger Gardner and Jason Grigsby, might fit the bill. Like other volumes in the “Head First” series, this book aims at deep understanding, rather than teaching you a great many things. So you shouldn't expect to come away from this book an expert in mobile Web application development, but you should come away with a good understanding of how to design a site such that it's appropriate for use with mobile devices.

Although I love Ruby (and Rails), I'm starting to look into a number of other languages, some of which I will explore in these pages during the coming year. One language I definitely want to spend more time learning and working with is Erlang, in which creating new processes is as fundamental, safe and easy as allocating a new string. Zach Kessin's book Building Web Applications with Erlang, published by O'Reilly, is an eye-opening introduction to the language and its use as a Web back end for massively scalable applications.

I must also mention R, a language designed for statistical work that I'm finding is increasingly in demand. The Art of R Programming, written by Norman Matloff and published by No Starch Press, is a great introduction to R as a programming language, not just for statistical programming. The R Cookbook, published by O'Reilly and written by Paul Teetor, is notable for the large number of basic and advanced techniques, presented clearly and without too much text or background, for aspiring R hackers.

And although it's not a programing language, I'm starting to understand and use tmux (tmux.sourceforge.net), an alternative to GNU Screen that is gaining many fans. tmux: Productive Mouse-Free Development, published by The Pragmatic Programmers and written by Brian P. Hogan, is short and practical, and really got me to appreciate how great this tool is and how much I need to use it even more in my work.

Databases

Readers of this column know I'm a big fan of PostgreSQL, which not only continues to be an excellent database, but also a great example of a well-run open-source project. However, as a consultant asked to work on a variety of different systems and platforms, and as someone who tries to apply the best tool to each job, I try to stay abreast of the latest goings-on with other open-source databases, both relational (SQL) and non-relational (NoSQL).

By all standards, MySQL is the most popular open-source database, and one of the main questions people always ask is, “How can I make my queries run faster?” An excellent book on the subject, now in its third edition, is High-Performance MySQL, written by Baron Schwartz, Peter Zaitsev and Vadim Tkachenko. It's true that this book focuses on the speed aspects of MySQL—how to design, index and query MySQL in the optimum ways, and then also how to figure out what “the optimum ways” are for your particular database. The chapters on replication (including master-master) and high availability were particularly interesting, both for someone coming from more of a PostgreSQL background and for understanding what tools and techniques are available (and standard) in the MySQL world.

Just as developers constantly should be learning new programming languages, it's also important to learn and work with new databases and storage systems. An interesting entry in this department is Seven Databases in Seven Weeks by Eric Redmond and Jim R. Wilson and published by The Pragmatic Programmers. As the title says, it introduces seven different databases—PostgreSQL, Riak, HBase, MongoDB, CouchDB, Neo4J and Redis—and shows how to work with each of them, broken down across several days per database. If you're interested in the differences (and similarities) between different database products, you almost certainly will enjoy this book.

Podcasts and Screencasts

I continue to be a big fan of podcasts, which I typically listen to while walking between train stations and my clients' offices. I find them to be fun, interesting, up-to-date and plugged in to the technical and other communities I want to follow.

My favorite podcast, hands down, is Ruby Rogues (rubyrogues.com), which I strongly recommend even for people who aren't Ruby developers, because of the excellent and interesting discussions of software engineering, object-oriented programing and entrepreneurship. The podcast keeps me laughing almost as much as it keeps me thinking. Charles Max Wood, who runs the Ruby Rogues podcast, has two others to which I subscribe: JavaScript Jabber (javascriptjabber.com) and Ruby Freelancers (rubyfreelancers.com). Although I enjoy those as well and try to listen to them as they are distributed, they don't seem to pack the punch of Ruby Rogues.

A podcast I have discovered only recently, but that I'm mentioning because it covers the high-tech world from a business perspective, is Mixergy, Andrew Warner's frequent interviews with entrepreneurs. It's always interesting for me to hear the stories of people who are creating successful businesses and to learn about what they have gone through in order to achieve success. I think it's important for software developers to know about the business, marketing and customer-service side of things; we tend to have a view that the software is the most important part of any business, when it's actually the customer experience and value.

I should also mention the Economist's Babbage podcast, which looks at the technology and high-tech worlds. Like Mixergy, it covers technology topics from a business perspective, but with the Economist's typical interesting insights and humor.

Screencasts continue to be a growing part of the on-line ecosystem, and although I don't watch as many of these as I would like (mostly because I cannot do so while walking to or from the train station), they can be quite interesting and useful. The weekly RailsCasts (railscasts.com) always are excellent, with Ryan Bates offering a $9/month “pro” subscription that provides additional screencasts as well.

A relative newcomer, at least to me, is Gary Bernhardt's Destroy all Software (www.destroyallsoftware.com/screencasts), a $9/month biweekly screencast mainly aimed at Ruby and Git, but with a large smattering of Python and Linux insights as well. I have found these to be quite interesting and useful, as well as humorous and focused.

The latest individual offering a paid monthly subscription to screencasts is Avdi Grimm, with his RubyTapas (rubytapas.com) ten-minute screencasts released three times each week, with the Monday edition being free of charge. Grimm is a well-regarded speaker and writer, and the few samples I've seen of this new offering have been interesting.

Finally, although they're not podcasts or screencasts, weekly e-mail newsletters have become increasingly useful, with links to interesting blog posts, books, releases and trends. You can think of these newsletters as smart, weekly RSS readers in your inbox. Among the newsletters I receive are “Ruby Weekly” (rubyweekly.com), “JavaScript Weekly” (javascriptweekly.com), “StatusCode” (statuscode.org), “Python Weekly” (www.pythonweekly.com) and “Freelancing Weekly” (freelancingweekly.com). I don't really read all of the links they present, but that's sort of the point. There's no way I would have time to find all of these links, let alone read them, on my own.

Other Books

There's not much room left for me to recommend my favorite non-computer books of the year. I was very excited to teach a Ruby class in Beijing in June 2012, and I prepared for that trip in part by reading some books. I already had recommended Peter Hessler's Country Driving, so it made sense for me to read (and now recommend) his two other books, Oracle Bones and River Town, both of which were as fascinating and deep as they were funny. I also read Postcards from Tomorrow Square by James Fallows and Dreaming in Chinese by Deborah Fallows; I didn't think that they were quite as strong as the Hessler books, but I still enjoyed them a great deal.

I also managed to learn a bit of Mandarin through ChinesePod (chinesepod.com), which not only helped me learn some of the language and customs, but also provided my children with hours of entertainment (or torture) as they listened to their father trying to mimic the sounds.

When I was younger, I thoroughly enjoyed Raymond Smullyan's writing, a logician and mathematician who wrote some great books of logic puzzles. I decided to get two of his books for my children to enjoy with me, and although I perhaps wore out my welcome with an overdose, we all enjoyed thinking through the puzzles in What is the Name of this Book?

Finally, if you're interested in understanding a bit about how the brain works and allows us to follow such puzzles, Thinking, Fast and Slow by Daniel Kahneman has been a pleasure to read, not only because of his insightful descriptions of how people think, but also for his descriptions of many great psychology experiments through the years, the designs of which are as interesting to me as the results they provided.

Reuven M. Lerner is a longtime Web developer, consultant and trainer. He is also finishing a PhD in learning sciences at Northwestern University. His latest project, SaveMyWebApp.com, went live this spring. Reuven lives with his wife and children in Modi'in, Israel. You can reach him at reuven@lerner.co.il.

LJ Archive