The JavaScript blog.


reviews apps iOS

Review: Kodiak JavaScript

Posted on .

Kodiak JavaScript (iTunes: Kodiak JavaScript, Price: $4.99) is an iOS IDE created by @becomekodiak, a group of developers that apparently really like bears.

Kodiak's file browser and editor views, and the sidebar.

This app comes bundled with over 50 libraries and frameworks familiar to JavaScript developers, and most of the features you might expect: syntax highlighting with various themes, a tabbed editor, a file navigator, and a preview mode that uses the built-in WebKit browser. It also supports Retina displays and external keyboards.

The settings panel allows the theme, font, and font size to be changed. I found DejaVuSansMono looked best. A preview is displayed in the same view so you can easily see what each option does.

The IDE settings and the impress.js demo being previewed.

I tried it out with some of the bundled libraries -- impress.js for example worked fine, and I made a quick scratch project just to get a feel for the basics.

One of the best features in the app is the keyboard. Much like other text or terminal apps, it includes a bar with commonly used keys along the top. It has a button in the centre which can be used to move the cursor around easily, and the other keys have gesture-based punctuation shortcuts which are great for quickly inserting quotes and brackets.

Kodiak doesn't like loading large files which I suspect is a limitation of their editor design -- for your own files it should be fine, but if you try to open a 40 KB JavaScript library it'll make the device slow down quite a bit. Also, large files can't be edited, they open in a read-only mode instead.

I don't remember VimTouch having limitations like that, but it's a very different application. In fact, I think the strength of Kodiak JavaScript lies in its educational value -- if you're starting out learning JavaScript it could be a great companion application to a suitable Kindle/iBooks eBook.

I noticed that one of the Kodiak developers has a GitHub account with some polished-looking Objective-C projects: Adam Horacek. This includes the cool keyboard found in the Kodiak apps, which is KOKeyboard. Adam's work is definitely worth taking a look at if you do any iOS development.


books reviews meteor

Book Review: The Meteor Book

Posted on .

Discover Meteor, by Sacha Greif and Tom Coleman

Sacha Greif sent me a copy of The Meteor Book, a new book all about Meteor that he's writing with Tom Coleman, and will be released on May 7th. He was also kind enough to offer a 20% discount to DailyJS readers, which you can redeem at discovermeteor.com/dailyjs (available when the book is released).

The book itself is currently being distributed as a web application that allows the authors to collect early feedback. Each chapter is displayed as a page, with chapter navigation along the left-hand-side of the page and Disqus comments. There will also be downloadable formats like PDF, ePub, and Kindle.

The authors teach Meteor by structuring the book around building a web application called Microscope, based on the open source Meteor app Telescope. Each chapter is presented as a long form tutorial: a list of chapter goals is given, and then you're walked through adding a particular feature to the app. Each code listing is visible on the web through a specific instance of the app, and every sample has a Git tag so it's easy to look up the full source at any point. I really liked this aspect of the design of the book, because it makes it easier for readers to recover from mistakes when following along with the tutorial themselves (something many DailyJS readers contact me about).

Accessing a specific code sample is easy in The Meteor Book

There are also "sidebar chapters", which are used to dive into technical topics in more detail. For example, the Deploying chapter is a sidebar, and explains Meteor deployment issues in general rather than anything specific to the Microscope app.

Although I work with Node, Express, Backbone.js (and increasingly AngularJS), I'm not exactly an expert on Meteor. The book is pitched at intermediate developers, so you'll fly through it if you're a JavaScript developer looking to learn about Meteor.

Something that appealed to me specifically was how the authors picked out points where Meteor is similar to other projects -- there's a section called Comparing Deps which compares Meteor's data-binding system to AngularJS:

We've seen that Meteor's model uses blocks of code, called computations, that are tracked by special 'reactive' functions that invalidate the computations when appropriate. Computations can do what they like when they are invalidated, but normally simply re-run. In this way, a fine level of control over reactivity is achieved.

They also explain the practical implications of some of Meteor's design. For example, how hot code reloading relates to deployment and sessions, and how data can be limited to specific users for security reasons:

So we can see in this example how a local collection is a secure subset of the real database. The logged-in user only sees enough of the real dataset to get the job done (in this case, signing in). This is a useful pattern to learn from as you'll see later on.

If you've heard about Meteor, then this book serves as a solid introduction. I like the fact a chapter can be digested in a single sitting, and it's presented with some excellent diagrams and cleverly managed code listings. It's not always easy to get started with a new web framework, given the sheer amount of disparate technologies involved, but this book makes learning Meteor fun and accessible.


books reviews

Book Review: JavaScript Enlightenment

Posted on .

JavaScript Enlightenment by Cody Lindley is a guide to JavaScript by giving native objects centre stage. It's self-published and available as
a PDF for \$15 through Google Checkout and PayPal (bulk licensing is
also available).

The book begins with an explanation of objects and properties:

In JavaScript, objects are king: Almost everything is an object or acts like an object. Understand objects and you will understand JavaScript. So let's examine the creation of objects in JavaScript.

Objects are explored in detail, with full examples of constructors,
native constructors, literals, and even how values are stored and
copied. Each example has source code with a link to jsFiddle, so it's
easy to play around with examples to attain new levels of JavaScript

Some of the more confusing aspects of JavaScript are covered early on,
particularly object comparison, primitive value object wrapping, and
prototype chain property reference resolution. The language used is
clear and easy to follow:

All object instances have a property that is a secret link (aka proto) to the constructor function that created the instance. This secret link can be leveraged to grab the constructor function, specifically the prototype property of the instance's constructor function.

Other fundamental JavaScript concepts like using
hasOwnProperty to correctly enumerate over objects are also
explained. In fact, I really couldn't find anything missing. If you've
ever wondered why JSLint is complaining about something, the root cause
is likely to be explained somewhere in this book.

The author even references modern libraries like

JavaScript 1.5 is lacking when it comes time to seriously manipulate and manage objects. If you are running JavaScript in web browser, I would like to be bold here and suggest the usage of Underscore.js when you need more functionality than is provided by JavaScript 1.5.

It's also encouraging to see solid coverage of Function
objects -- one of the hidden aspects of JavaScript that can unlock
serious power if used carefully. Slightly confusingly,
apply and call are only covered briefly here,
with more thorough coverage in chapter 6. The split between explaining
this and Function felt slightly awkward, which
is one of the reasons why this book works better taken as a whole rather
than discrete chunks.

The author carefully notes where JavaScript implementations deviate from
the ECMA standard, and explains the cleanest way to mitigate this.


If you've ever wondered how prototypal inheritance works, or just want
to bolster your JavaScript knowledge, this is an extremely potent book.
It's short -- readable in a handful of sittings, but it works best read
from start to finish.

Although the technical foundation of this book is solid and the writing
is clear and concise, it would benefit from an editor with a more
scrupulous eye. There are a few typographical and grammatical errors
that conspire to undermine the author's authority. For example, I got
extremely tired of repeatedly reading the phrase the take away.
Hopefully Cody will keep publishing new editions, so don't let this stop
you from reading one of the most interesting books on JavaScript this


reviews learning

JavaScript Master Class: A Review

Posted on .

Last week I attended Amy Hoy's and Thomas Fuchs's JavaScript
Masterclass: Virtual Edition October
. This article is an account of
my experience. Hopefully it will help you decide whether to attend their
next class.

Ric's Disclaimer: Although I admit to generally being a fan of Amy's and Thomas's work, I've tried to write a balanced review, and I
paid full price for my ticket.


The class mainly took the form of either Amy or Thomas - one at a time -
talking through slides and examples via live video and screen-sharing
(using Adobe Connect). There were two four-hour sessions (across 2 days) with breaks every hour or so, during which there were optional exercises
to complete based on the content just covered. There was also a more
challenging 'homework' exercise after the first day's session.

Whoever of Amy or Thomas weren't presenting were available in a
Campfire room for questions, clarification and general chat. There were twenty or so people in the class (and therefore
the chatroom), so I was initially worried that the chat room would be
too busy, but in my class only about half a dozen people actively
participated in the chat room, so it was easy to get my questions

This format worked really well, and didn't require an especially fast
Internet connection (I know this because my ISP was having problems on
the second day, and I had to connect using a 3G mobile modem!).

The slides (in original, and printable format) were available for
download before the course started, which I found useful since I
occasionally wanted to dwell on a slide. A recording of the video and a
transcript of the chat room were available for download a few days after
the class.

As a bonus, included in the price of the course (\$429), was a copy of
the JavaScript Performance Rocks e-book, which we
reviewed last year.


Day One

The first day was presented by Amy (with Thomas in the chat room) and
covered JavaScript language principles including:

  • JavaScript's object model
  • Metaprogramming
  • Functions
  • Closures and scope
  • Extending the language
  • JSON
  • Constructors and prototypes
  • Mix-ins and inheritance

Day Two

Day Two moved on from esoteric language concepts on to how most of us
use JavaScript 'in the real' world i.e. in a browser context. The first
part was presented by Amy again and covered:

  • Browsers
  • The DOM
  • Events
  • Frameworks, such as Prototype.js

For the latter part of the second day, Thomas took over presenting and
Amy migrated to the chat room. Thomas gave some advice about how to
manage your own JavaScript projects, with the following topics:

  • Minification
  • Namespaces
  • Deployment
  • Preprocessors like Sprockets.js
  • Refactoring
  • Performance
  • Unit Testing
  • Documentation


The class was billed as a framework-agnostic course intermediate for
advanced level JavaScript developers, who want to "level up to expert".

I don't consider myself to be particularly advanced when it comes to
JavaScript, but I found that the Language parts of the course (i.e. Day
One and the first part of Day 2) were mainly just revision, although
Amy's and Thomas's explanations of the concepts (as well as the
exercises) did help to clarify my understanding.

It was great to get an insight into how experts like Thomas go about
organising large projects such as
Prototype.js, Script.aculo.us and Freckle (their time-tracking app).

Regarding framework agnosticism, although no prior knowledge of any
frameworks were required before the course, many examples were taken
from Prototype.js, (so being familiar with this helped) and the
presenters certainly weren't afraid of voicing their opinions of other
popular JavaScript frameworks. :)

I would have liked to have seen less focus on language concepts,
although they certainly did a good job of explaining them, and more
practical advice on applying them in different situations.

Having said that, I certainly felt that I got something from the course.
The content was engaging and well prepared, and it was fun to chat with
Amy, Thomas and the other participants (and ask their advice and
opinions on the matters covered). It's not often you get the opportunity
to get the attention of a true JavaScript master like Thomas Fuchs for a
full eight hours - for me, this was worth the admission fee alone.


server reviews services


Posted on .

Akshell is a web application hosting service that uses an MVC framework built on V8 JavaScript, PostgreSQL, and
Python. It can be used to build JavaScript applications completely
inside a browser. There's also a command-line
that can ease
Akshell into a traditional local development workflow.

Akshell is attempting to create an ecosystem of apps that can be used to
build larger apps. It's a bit like the unix way of thinking -- creating
simple, almost atomic tools that can be networked together. Despite the
obvious Google App Engine and Heroku comparisons, the consistent push of
this philosophy makes Akshell slightly different.


Akshell uses simple permissions and Spots to facilitate collaboration.
Developers can work on non-release "spots", then the administrator can
deploy. Spots are like branches.

Building Apps

To try Akshell, sign up on the site
then create an application by filling out the fields:

Next, navigate to Code then select main.js in the file editor. Paste
in this code:

require('ak', '0.2').setup();

function fibonacci(n) {
  if (n == 0) return 0;
  if (n == 1) return 1;

  var n1 = 0,
      n2 = 1,
      result = 0,

  for (i = 2; i <= n; ++i) {
    result = n1 + n2;
    n1 = n2;
    n2 = result;

  return result;

var IndexHandler = Handler.subclass({
    get: function (request) {
      var n = request.get.n || 10;
      return render(
        'index.html', {
          header: 'The Fibonacci Sequence',
          count: n,
          result: fibonacci(n)

exports.root = new URLMap(
  IndexHandler, 'index'

This generates Fibonacci numbers. If a get parameter is present, n,
the app will use it to generate numbers from the Fibonacci sequence.

Make sure to save main.js. Navigate to templates then
index.html and paste this into the existing block:

  {{ "{{ header " }}}}
  Fibonacci up to: {{ "{{ count " }}}}
  Result: {{ "{{ result " }}}}

Save, then click the arrow that appears when mousing over the debug
spot and select Release from the menu. The Release spot also has a
menu with Show which will display your app.

Finding Documentation

When I built the small example above, I read through the User Guide
and Reference documents here: Akshell
. Familiarity with
projects like Rails, Sinatra and Express will translate directly into
Akshell's APIs.


Akshell's about page makes it look like Anton Korenyushkin singlehandedly developed the product. If so, he's
clearly a maverick genius. He definitely seems like a programmer's
programmer, which I'm cool with -- Akshell is easy to learn, fast, and
fun to play with. However, that does mean the overall design isn't
kick-ass, and the text on the site could do with some copywriting.

Given these minor limitations, it's also worth being aware that apps
must be released open source under the BSD or MIT licenses. I don't
think this is a massive problem, but it makes me wonder why Akshell's
core isn't open source. If it's just because Anton wants to get feedback
and prepare commercialisation through optionally closed paid apps,
that's OK by me.

Right now, Akshell is off to a promising start. Continued development,
commercialisation, and user interface improvements could make it take
off in a bigger way.