JavaScript Frameworks for Modern Web Dev

JavaScript Frameworks for Modern Web DevI am thrilled to announce the publication of my newest book, JavaScript Frameworks for Modern Web Dev, available now from APress!

A year ago my friend and former co-worker Tim Ambler approached me with a project: a list of strong frameworks and libraries in the JavaScript space that can each be effectively introduced in a single chapter. Over the last twelve months we wrote numerous drafts and revisions, and created a somewhat frightening amount of source code for these sixteen topics:

  1. Bower
  2. Grunt
  3. Yeoman
  4. PM2
  5. RequireJS
  6. Browserify
  7. Knockout
  8. AngularJS
  9. Kraken
  10. Mach
  11. Mongoose
  12. Knex and Bookshelf
  13. Faye
  14. Q
  15. Async.js
  16. Underscore and Lodash

Obviously, the scope of each topic is greater than its chapter, but the book’s goal is to be a quick but thorough introduction to the core concepts in each framework and library. The source code is non-trivial and executable, so a reader can see concepts in action while following along in the text.

Some of the technologies covered have aged (like fine wine!), and some are much younger, but we believe that each has staying power and stands well among its peers. Between us we have used all of these technologies in our own projects and in production deployments, and while we cannot claim complete expertise, we humbly submit that, to the best of our knowledge, the information here is both sound and practical.

We sincerely hope that this book brings much value to you and your team!

 

 

Modern Web Practices ebook launched!

Today is a big day for me. Today I become (dramatic pause)… a published author!

I am excited to announce the launch of the Modern Web Practices ebook, a collection of six chapters on web development forged in the fiery crucibles at appendTo!

  • Preface by Michael Hostetler
  • Chapter 1: Automate Your Workflow with Grunt by Aaron Bushnell
  • Chapter 2: Offline Web Applications by Nicholas Cloud
  • Chapter 3: Data Binding by Ryan Conaway
  • Chapter 4: Making Things Move with CSS3 Transitions and Animations by Trevan Hetzel
  • Chapter 5: HTML and CSS Bad Practices by Ted Waller
  • Chapter 6: Bower in Practice: A Package Manager for the Web by Bob Yexley

Writing anything worth publishing is a grueling process, and I am both humbled and impressed by the creativity, dedication, and enthusiasm of my fellow co-authors.

We all hope that you’ll buy the ebook of course, but we also hope that it will–in some tangible and meaningful way–help you grow and succeed in your career.

Maintainable JavaScript (book review)

Maintainable JavaScriptJavaScript has, it seems, finally come into its own, and with its new immense popularity, attracted the attention of opinionated writers of every ilk.  The latest book in O’Reilly’s growing collection of excellent books on all things JavaScript — Maintainable Javascript by Nicholas Zakas — is a worthy addition to the cannon, not because it brings anything new to the table per se, but because it consolidates a lot of different source material into a roadmap of sorts, useful for two primary target audiences: 1) developers who are new to JavaScript development but are otherwise familiar with traditional software practices such as unit testing, continuous integration, structured builds, etc., and 2) casual JavaScript developers who have probably hacked some jQuery in the browser but are really interested in what all the cool kids are doing now.

Zakas, a former Yahoo employee with blood, sweat and tears invested in YUI, has divided his work into three parts, two of which are augmented by detailed appendixes.

The first part covers JavaScript style guidelines, and is really a cross-section of The Gospel According to Douglas Crockford (a.k.a., The Good Parts), and YUI, jQuery and Dojo recommended coding conventions.  The JavaScript community is anything if not opinionated, and the division over minutia really shines in this section.  Zakas stresses that, “[r]ather than trying to force my preferences upon you, this [section] highlights important aspects that should be covered in your style guidelines.”  He notes that his own personal heresies can be found in Appendix A in case the official dissension isn’t enough.  Though I troll, the material in section one is still pretty important.  Zekas is right when he claims that teams should make an effort to follow consistent guidelines (regardless of which guidelines they happen to prefer).  Style variations in big projects can be a source of confusion at best, and costly bugs at worst.  There are many conventions on which JavaScript community leaders agree, and when they differ, it is often obvious that preference, not actual danger, is the driver.  Seasoned developers will feel at home reading about formatting, commenting, proper statement and expression structure, and how to property declare variables and functions.  For junior folk, or those new to the language, these conventions can be invaluable specifically because JavaScript behaves in ways that are occasionally surprising (e.g., variables are scoped at the function level, not the block level, so variable declarations can be trickier than most other languages).

In part two, Zakas examines some best practices for writing JavaScript code.  There is less subjective material here, mostly because “best practices” in JavaScript are like guard rails on a highway.  They are not there for aesthetic appeal, they are there to save your life.  Veteran JavaScript developers know how malleable JavaScript code can really be and prefer to prevent accidents rather than recover from them.  Zakas discusses the dangers of global objects, the problems with type coercion and equality checks, when and how to safely modify objects, best practices for throwing and handling errors, and several other topics (like separation of concerns) that, while not particular to JavaScript, remain treasured as received wisdom.

Part three is not so much about JavaScript code as it is about structuring and running a JavaScript project.  Most developers first experienced JavaScript as a second-hand language used to manipulate web pages but otherwise, considered it inconsequential.  JavaScript is now a first class citizen among languages, though, and as projects increase in size and complexity, a number of tools and practices have emerged to make managing those projects easier.  Zakas starts this section by discussing a build process, for which he chose the well-known tool Ant as a demonstration candidate.  The build process forms the backbone of each chapter in this section, as each topic relates to the build process in some way.  A few salient chapters cover common browser needs, such as file concatenation and minification, and several others cover universal concerns such as automated documentation and  automated testing (both unit and integration).  Zakas covers a primary technology in each chapter (e.g., JSDoc toolkit for automated documentation) but provides a very useful, fairly comprehensive list of alternatives in an appendix.  The final chapter in this section looks at the total build configuration with all moving parts — a very useful ten-thousand foot view of a large-scale JavaScript project setup.

Maintainable JavaScript is fairly short, and quite enjoyable, although I feel that it does repeat a great deal of content from Crockford, et al, especially in the first two sections.  This is not necessarily bad, but if the reader is already familiar with the opinions of these community leaders, it would be acceptable (and beneficial) to forego the first two sections and jump straight to section three.  The appendices are also useful for all readers, regardless of previous exposure.  JavaScript virgins would do well to pay attention to all sections, however, and would also do well to read Crockford, if only for his more esoteric explanations of JavaScript’s quirks and goods. Zakas does a good job making this information accessible and concise, and his inclusion of alternative perspectives provides a wider view of the community as a whole.

If you’re new to JavaScript, or you’re looking to stand up your first significant JavaScript project, invest in this book.  It is money well spent.

A Book Apart sponsors STL ALT.NET

When I ask my web UI friends what resources they would recommend to a n00b looking to develop his HTML and CSS chops, the near universal answer is to direct me to the wonderful websites A List Apart and its publishing arm, A Book Apart.  For years these websites have been delivering high-quality, non-trivial articles and books on front-end web development and design.  They are universally acknowledged as accurate, if not authoritative, sources of knowledge, and have been a tremendous help to me in my professional career.

A Book Apart has graciously donated one copy of each book in the Complete A Book Apart Library to be raffled during the next several months at STL ALT .NET meetings:

Each volume is a concise and fresh take on an important field in web design. Jeremy Keith’s HTML5 for Web Designers explores what the web’s new lingua franca means for working designer/developers. Dan Cederholm’s CSS3 for Web Designers shows how you can design for the experience layer today. Erin Kissane’s The Elements of Content Strategyexplains where content strategy came from, and how you can do it well. Ethan Marcotte’s Responsive Web Design demonstrates CSS techniques and design principles for crafting fluid, responsive websites. Aarron Walter’s Designing for Emotion will teach you how to you make your users fall in love with your site, while Luke Wroblewski’s Mobile First will make you a master of mobile, and improve your desktop designs, too. 

Mobile First and Responsive Web DesignI personally own digital copies of each book in this series, and I’ve finished three of six.  Of particular interest to me were Ethan Marcotte’s Responsive Web Design and Luke Wroblewski’s Mobile First.  Both of these books take a long look at the current state of mobile web development, and make a compelling argument that not only should developers be aware of the issues and technologies involved with the mobile web, but they should be coding their websites to take advantage of those things right now.  Mobile first design — once onerous in CSS2 and HTML4 — is becoming the standard design approach as mobile phones and tablets saturate the consumer market.  Mobile First makes the technological and business cases for embracing the mobile web, while Responsive Web Design shows how this can be achieved with fluid layouts, flexible images, and CSS3 media queries.

I have nothing but the highest opinion for A Book Apart, and I am excited that STL ALT .NET members will get to experience this awesomicity as well!

Sad day for Borders

Borders Bookstore has long been close to my heart.  With good coffee, free Wi-Fi, a relaxing atmosphere, and a great selection of books, it became one of my de facto hangouts for meeting with friends or studying in high school.  Unfortunately Borders filed for Chapter 11 yesterday and will be closing 30% of its brick and mortar stores–three of which are in the St. Louis area.

  • Ballwin (1535S-A Manchester Rd.)
  • Chesterfield (2040 Chesterfield Mall)
  • St. Peters (1320 Mid Rivers Mall)

Fortunately my default Borders, the Creve Coeur location, remains open for business, but it’s sad to see the bookstore chain languishing in hard times.  Of all the bookstore giants in the area (including Barnes & Noble and Books-a-Million), Borders has, by far, the best computer, philosophy, and literature selections–the three topics I am most interested in.

If you want to check the status of Borders stores near you, the Wall Street Journal has published a comprehensive list.

Books for Christmas

Santa was very good to me this year, expanding my bookshelf by several awesome volumes.

2010 Christmas Books