Introduction - QUICK START - Rapid Prototyping with JS: Agile JavaScript Development (2014)

Rapid Prototyping with JS: Agile JavaScript Development (2014)

Introduction

Summary: reasons behind rapid prototyping in general and writing of this book; answers to questions what to expect and what not, what are prerequisites; suggestions on how to use the book and examples; explanation of book’s notation format.

“Get out of the building.”Steve Blank

Rapid Prototyping with JS is a hands-on book which introduces you to rapid software prototyping using the latest cutting-edge web and mobile technologies including Node.js, MongoDB, Twitter Bootstrap, LESS, jQuery, Parse.com, Heroku and others.

Why RPJS?

This book was borne out of frustration. I have been in software engineering for many years, and when I started learning Node.js and Backbone.js, I learned the hard way that their official documentation and the Internet lack in quick start guides and examples. Needless to say, it was virtually impossible to find all of the tutorials for JS-related modern technologies in one place.

The best way to learn is to do, right? Therefore, I’ve used the approach of small simple examples, i.e., quick start guides, to expose myself to the new cool tech. After I was done with the basic apps, I needed some references and organization. I started to write this manual mostly for myself, so I can understand the concepts better and refer to the samples later. Then StartupMonthly and I taught a few 2-day intensive classes on the same subject — helping experienced developers to jump-start their careers with agile JavaScript development. The manual we used was updated and iterated many times based on the feedback received. The end result is this book.

What to Expect

A typical reader of RPJS should expect a collection of quick start guides, tutorials and suggestions (e.g., Git workflow). There is a lot of coding and not much theory. All the theory we cover is directly related to some of the practical aspects, and essential for better understanding of technologies and specific approaches in dealing with them, e.g., JSONP and cross-domain calls.

In addition to coding examples, the book covers virtually all setup and deployment step-by-step.

You’ll learn on the examples of Chat web/mobile applications starting with front-end components. There are a few versions of these applications, but by the end we’ll put front-end and back-end together and deploy to the production environment. The Chat application contains all of the necessary components typical for a basic web app, and will give you enough confidence to continue developing on your own, apply for a job/promotion or build a startup!

Who This Book is For

The book is designed for advanced-beginner and intermediate-level web and mobile developers: somebody who has been (or still is) an expert in other languages like Ruby on Rails, PHP, Perl, Python or/and Java. The type of a developer who wants to learn more about JavaScript and Node.js related techniques for building web and mobile application prototypes fast. Our target user doesn’t have time to dig through voluminous (or tiny, at the other extreme) official documentation. The goal of Rapid Prototyping with JS is not to make an expert out of a reader, but to help him/her to start building apps as soon as possible.

Rapid Prototyping with JS: Agile JavaScript Development, as you can tell from the name, is about taking your idea to a functional prototype in the form of a web or a mobile application as fast as possible. This thinking adheres to the Lean Startup methodology; therefore, this book would be more valuable to startup founders, but big companies’ employees might also find it useful, especially if they plan to add new skills to their resumes.

What This Book is Not

Rapid Prototyping with JS is neither a comprehensive book on several frameworks, libraries or technologies (or just a particular one), nor a reference for all the tips and tricks of web development. Examples similar to ones in this book might be publicly available online.

Even more so, if you’re not familiar with fundamental programming concepts like loops, if/else statements, arrays, hashes, object and functions, you won’t find them in Rapid Prototyping with JS. Additionally, it would be challenging to follow our examples.

Many volumes of great books have been written on fundamental topics — the list of such resources is at the end of the book in the chapter Further Reading. The purpose of Rapid Prototyping with JS is to give agile tools without replicating theory of programming and computer science.

Prerequisites

We recommend the following things to get the full advantage of the examples and materials covered:

· Knowledge of the fundamental programming concepts such as objects, functions, data structures (arrays, hashes), loops (for, while), conditions (if/else, switch)

· Basic web development skills including, but not limited to, HTML and CSS

· Mac OS X or UNIX/Linux systems are highly recommended for this book’s examples and for web development in general, although it’s still possible to hack your way on a Windows-based system

· Access to the Internet

· 5-20 hours of time

· Some cloud services require users’ credit/debit card information even for free accounts

How to Use the Book

For soft-copy (digital version) the book comes in three formats:

1. PDF: suited for printing; opens in Adobe Reader, Mac OS X Preview, iOS apps, and other PDF viewers.

2. ePub: suited for iBook app on iPad and other iOS devices; to copy to devices use iTunes, Dropbox or email to yourself.

3. mobi: suited for Kindles of all generations as well as desktop and mobile Amazon Kindle apps and Amazon Cloud Reader; to copy to devices use Whispernet, USB cable or email to yourself.

This is a digital version of the book, so most of the links are hidden just like on any other web page, e.g., jQuery instead of http://jquery.com. In the PDF version, URLs are in the footnotes at the bottom of the page. The table of contents has local hyperlinks which allow you to jump to any part or chapter of the book.

There are summaries in the beginning of each chapter describing in a few short sentences what examples and topics the particular chapter covers.

In PDF, EPUB and Mobi versions you could use the Table of Contents, which is in the beginning of the book and has internal links, to jump to the most interesting parts or chapters.

For faster navigation between parts, chapters and sections of the book, please use book’s navigation pane which is based on the Table of Contents (the screenshot is below).

The Table of Contents pane in the Mac OS X Preview app.

The Table of Contents pane in the Mac OS X Preview app.

Examples

All of the source code for examples used in this book is available in the book itself for the most part, as well as in a public GitHub repository github.com/azat-co/rpjs. You can also download files as a ZIP archive or use Git to pull them. More on how to install and use Git will be covered later in the book. The source code files, folder structure and deployment files are supposed to work locally and/or remotely on PaaS solutions, i.e., Windows Azure and Heroku, with minor or no modifications.

Source code which is in the book is technically limited by the platform to the width of about 70 characters. We tried our best to preserve the best JavaScript and HTML formatting styles, but from time to time you might see backslashes (\). There is nothing wrong with the code. Backslashes are line escape characters, and if you copy-paste the code into the editor, the example should work just fine. Please note that code in GitHub and in the book might differ in formatting. Also, let us know via email (hi@rpjs.co) if you spot any bugs!

Notation

This is what source code blocks look like:

1 var object = {};

2 object.name = "Bob";

Terminal commands have a similar look but start with dollar sign or $:

1 $ git push origin heroku

2 $ cd /etc/

3 $ ls

Inline file names, path/folder names, quotes and special words/names are italicized, while command names, e.g., mongod, and emphasized words, e.g., Note, are bold.

Terms

For the purpose of this book, we’re using some terms interchangeably, while depending on the context, they might not mean exactly the same thing. For example, function = method = call, attribute = property = member = key, value = variable, object = hash = class, list = array, framework = library = module.