About This Book

Javascript Is Now a General Purpose Application Building Language

Javascript entered the scene in the realm of building web pages enabling authors to add dynamic effects to web pages. It has grown up to become a language capable of expressing the entire application. Now in order to program an application that will run anywhere (any hardware, any operating system) you need only know one procedural language (javascript), html, and css. No longer is it necessary to know a different language, e. g. PHP, Java, Ruby, or Perl for server side “backend” logic. That is the point of this book.

I will demonstrate in the book how to build an application using just javascript and html that will run as a web page or local application (with no need for an internet connection. And you can run it on a Windows machine, a Mac, or a Linux machine without changes. You can run it on mobile devices, too.

Any application can be written this way, major number crunching, impressive graphics, data base intensive applications.

No doubt, the legacy languages will survive for quite some time for various reasons. Seldom will performance be the actual determinant. Javascript has become fast and is becoming faster as time goes on.

This book deliberately emphasizes the minimalist basics. Using the techniques presented here will enable development of sophisticated applications without the need to go far afield. Yes, you can add various frameworks to simplify your life as a developer, but it is still all just javascript. If you understand this book, you are well equipped to tackle the many frameworks that have evolved.

The code for the samples is available and is downloaded during the “Getting Started” chapter. You may key it in yourself if doing so helps you to learn (recommended), but the downloaded code is there for comparison if you get stuck on some stupid syntax error.

Node JS is used to implement server side code in this book. Most of the logic in the samples is client side, the little server side code could easily be accomplished in PHP or any other server side language.

I use Heroku as my web host. Heroku is developer friendly with free accounts for developers, and friendly scaling to paid production traffic volumes. I encourage you to get an account so that you may show off your accomplishments.

HTML5 is used to define the pages of the samples

The book consists of three examples: a file editor, a chat window, and a graphics editor. The file editor illustrates the relationship of a page’s html to the client side javascript and the server side function. The chat window allows multiple clients to chat to illustrate how to implement multiple client applications such as competitive game playing or collaboration. The graphics editor illustrates how to draw grapics and animate them.