Realtime Web Apps

Author: Jason Lengstorf & Phil Leggetter
Publisher: Apress
Pages: 290
ISBN: 978-1430246206
Audience:  Intermediate to advanced JavaScript programmers
Rating: 2
Reviewer: Ian Elliot

What exactly is a realtime web app? Does this book help you understand them in general?

The subtitle of this book is "With HTML5 WebSocket, PHP", and jQuery which gives you a good idea of the sort of thing the book is about. It certainly isn't about WebRTC or any other more "up-market" forms of realtime media and communications. This is essentially about establishing a two-way data exchange between the client and the server.

This is the sort of thing that techniques such as long polling and HTTP streaming were invented to do. If you don't know what these are, don't worry because chapter 1 does a good job of explaining the idea of each of them. It then moves on to consider its proposed solution - WebSockets. The general idea is explained and detail is given down to the protocol used. However, no explanation of using the API is provided.




Chapter 2 looks at the tools you need to build a real time app. This is a strange set of topics including such really basic things as HTML5, CSS and JavaScript. None of these three are introduced in enough detail to be of any use to you if you didn't know about them before. If you did then there is very little point in looking at the long listings the chapter presents. It then goes on to look at jQuery, PHP, MySQL and WebSockets in the same way. I really don't understand why these are introduced at such an abstract level and yet there is a lot of code presented. 

More importantly the key technology promoted by the book, i.e. WebSockets, is treated in the same fashion. It simply tells you what it is for and then shows you an example program. There's no explanation of the API and how it all works - just one example. 

Chapter 3 introduces Pusher, which is a polyfiller library that implements the same sort of features that you get with WebSockets but also has fallbacks to the older technologies when the browser doesn't support the new. This time we have a little more explanation of how to use the API but it is still full of long examples with very little in the way of details. A three-page PHP program, complete with lots of code irrelevant to sending data, is presented before we get a breakdown of how things should be done. You mostly have to learn how to use the API by already knowing.



Part II moves on to the main occupation of the book - building one large example. Chapter 4 goes off target by discussing the native v web apps issue - marketing, sales, features and so on. Chapter 5 is still at the design and management level with a look at what exactly the app should do - Give the App a Mission Statement. Next we are into what makes good markup and then into the idea of MVC and database normalization.

I thought this book was about realtime apps?

You can argue that these are issues that are relevant to realtime apps because they are relevant to all apps - but this is a short book and we haven't had a good explanation of the WebSockets API by this point. The chapter finished with page after page of wireframe designs for the pages we are about to implement. 

Part III moves on to creating the app. Chapter 6 is called Designing the App and it considers ... choosing a font.  You might find the extended discussion of how to design a form interesting, but I thought I was going to be reading about realtime techniques not how to pick a font. 

Chapter 7 is about creating HTML and CSS and presents the markup and CSS that implements the pages we have considered earlier. There is a lot of listing of very basic markup and very little explanation. 

Chapters 8 and 9 do get to some code as they are about building the back end. Here you get to build your own MVC framework but again the style is to present you will lots of listings with minimal explanation. This is more like an annotated listing than a book chapter. 

Chapter 10 deals with using jQuery to apply animations to the pages and chapter 11 explains Oauth and how to add it to the example application.

At the end of the book you will have learned very little about WebSockets and not much about realtime in general. You will have seen a complete example being built and had lots of rapid explanations of standard technologies such as HTML5.

As a case study it might have some value but as a way to explain how to build realtime apps it isn't very effective. Even with the attempts at introducing the basics you are going to need a good grasp of HTML, CSS, JavaScript and PHP to make anything at all of this book and despite the fact it claims to be aimed at the beginner to intermediate level it is more like intermediate to advanced. 

If you are looking for an introduction to WebSockets and how to use them to build a realtime app you are going to be disappointed in this book. If you want a big example of a complete app then you might get something from reading through, but you are going to have to work quite hard to find the bits that deal with realtime communications among all of the detail concerning the rest of the app's design, implementation and behavior.


How to Grow a Robot: Developing Human-Friendly, Social AI

Author: Mark H. Lee
Publisher: MIT Press
Pages: 384
ISBN: 978-0262043731
Print: 0262043734
Kindle: B0874BMM14
Audience: Developers interested in how robotics and AI can be combined.
Rating: 5
Reviewer: Kay Ewbank

This book sets out to look at how robots can be more human-like, friendly and engaging. [ ... ]

Learning Progressive Web Apps

Author: John M Wargo
Publisher: Addison-Wesley
Pages: 272
ISBN: 978-0136484226
Print: 0136484220
Kindle: B084T4JK3S
Audience: Capable JavaScript programmers
Rating: 4.5
Reviewer: Ian Elliot
PWAs - I'm not even sure what they are?

More Reviews


Last Updated ( Wednesday, 19 February 2014 )