Seven Web Frameworks in Seven Weeks
Adventures in Better Web Apps
by Jack Moffitt, Fred Daoud
Version: P1.0 (January 2014)
Copyright 2014 The Pragmatic Programmers, LLC. This book is licensed tothe individual who purchased it. We don't copy-protect itbecause that would limit your ability to use it for yourown purposes. Please don't break this trustyou can use this across all of your devices but please do not share this copywith other members of your team, with friends, or via file sharing services. Thanks.
Dave & Andy.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and The Pragmatic Programmers, LLC was aware of a trademark claim, the designations have been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The Pragmatic Programmer, Pragmatic Programming, Pragmatic Bookshelf and the linking g device are trademarks of The Pragmatic Programmers, LLC.
Every precaution was taken in the preparation of this book. However, the publisher assumes no responsibility for errors or omissions, or for damages that may result from the use of information (including program listings) contained herein.
Our Pragmatic courses, workshops, and other products can help you and your team create better software and have more fun. For more information, as well as the latest Pragmatic titles, please visit us at http://pragprog.com.
The team that produced this book includes:
Bruce A. Tate (series editor)
Jacquelyn Carter (editor)
Potomac Indexing, LLC (indexer)
Molly McBeath (copyeditor)
David J Kelly (typesetter)
Janet Furlow (producer)
Ellie Callahan (support)
For international rights, please contact .
For the Best Reading Experience...
We strongly recommend that you read this book with the publisher defaults setting enabled for your reading device or application. Certain formats and characters may not display correctly without this setting. Please refer to the instructions for your reader on how to enable the publisher defaults setting.
Table of Contents
Copyright 2014, The Pragmatic Bookshelf.
Early Praise for Seven Web Frameworks in Seven Weeks
The title implies a breadth-first analysis of some fairly disparate technologies, but there is a surprising amount of depth here, more than enough to emphasize the essential qualities of each one. If youre a polyglot, or aspire to be, this book is a very large ball of awesome.
Jim Crossley |
Immutant core team member; principal software engineer, Red Hat |
Objective and clear. More than an introduction, its a head start! Just as wide and as deep as any modern developer would like. I definitely recommend it.
Pablo Aguiar |
Software engineering consultant |
This book is great fun. The authors guide you quickly through each framework, in each case giving you a fast but clear, coherent, and surprisingly detailed taste that includes major features, design philosophy, implementation, and testing, plus hints for further investigation. Two JavaScript frameworks, one Ruby, one Haskell, two Clojure, and one Erlang. If you like web programming, youre going to enjoy this book.
Giles Bowkett |
Experienced developer and well-known blogger |
I thoroughly enjoyed reading the book. In fact, the Yesod chapter even gave me fresh ideas on how to expose non-Haskellers to the strengths of a strong type system.
Michael Snoyman |
Creator of Yesod; lead software engineer, FP Complete |
Foreword
In 2003, I took my family to Durango, Colorado, where we rode on the Durango & Silverton train. The narrow gauges of the railroad once served well against the narrow red sandstone cliffs, where every inch of space was at a premium. These days, the train is a relic of the past, rendered obsolete by cars and planes that are safer and more efficient. Time marches on.
Today, too, we witness revolution. Single-core computers are dead or dying. True, their multicore descendants are technical marvels. They also represent a tremendous technical challenge. The languages we used to depend on do not work as well as they once did. As a result, we are seeing a new generation of languages emerge. So far, no one has been kind enough to declare a winner.
Against this backdrop in 2010, I wrote Seven Languages in Seven Weeks . In truth, I didnt expect it to sell many copies. After all, it was a book about languages in a Java world; a book about programming paradigms in a time where everything was object oriented. Still, programmers sensed the danger of our stagnating skills and embraced the concept that learning programming languages for the sake of learning them can make you smarter and better able to cope with change. The book was a resounding success.
Three years later, theres still no clear leader, though functional programming is starting to gain traction. Were finding that the multicore wafer tossed into our virtual pond years ago has created waves that are increasing in size and velocity. We need more than inheritance to organize our code. We need robust frameworks on the client to handle the robust development that is happening there. And we need true concurrent frameworks to take full advantage of their concurrent languages.
Its just not enough to lay wider tracks over the narrow tracks we used last year.
In this book, Fred and Jack will show you the leading edge of people who are reinventing the way web development should be done. Youll see a traditional object-oriented framework called Sinatra. Youll move on to the client side, where exciting things are happening with JavaScript. Youll take a tour of CanJS and AngularJS to see how to do full, rich client-side development. Next, youll swing back to the server side to see whats happening in functional languages. Youll encounter two Clojure frameworks in the minimalist Ring and the robust Immutant. Youll see a state machine--based design in Erlang called WebMachine. If those arent enough to blow your mind, youll find the incredibly powerful Haskell framework called Yesod.
The Seven in Seven books are designed to expand your mind. I am extremely proud to bring you this next installment, Seven Web Frameworks in Seven Weeks . Its my sincerest hope that this book will take you beyond whatever tracks are holding you back.
Best regards,
Bruce Tate
CTO, icanmakeitbetter.com
Copyright 2014, The Pragmatic Bookshelf.
Acknowledgments
We would like to thank the team at the Pragmatic Bookshelf for making this book possible. Thanks especially to Jackie Carter, our editor, for all of her expertise and tireless efforts to make this book better and for bringing it to the finish line. Thanks also to Bruce Tatewe are both fans of his book, and we are honored to follow in his footsteps. Thank you, Andy Hunt and Dave Thomas, for creating such a great environment in which to write about the technical subjects that we all find fascinating.
Thanks to the technical reviewers who contributed their expert advice on each framework: Konstantin Haase (Sinatra), David Luecke (CanJS), Miko Hevery (AngularJS), James Reeves (Ring), Justin Sheehy (Webmachine), Michael Snoyman (Yesod), Jim Crossley and Toby Crawley (Immutant) and to the reviewers who offered their comments and suggestions for various chapters of the book: Kimberly Hagen, Kevin Wiley, Pablo Aguiar, Mick Thompson, Christopher Zorn, Nathaniel Schutta, and Aaron Bedra.