I write custom software for a living. It’s usually fun, sometimes challenging, often tedious, but overall gratifying in a number of ways. One of these ways is that I get to be creative and build my own tools that help me write better software that is quicker to write, easier to support, and is more [...]
delicious robots blog
javascript
Root.js : A Skeletal MVC Framework for Node.js
OK, by skeletal, I mean absolutely no fat whatsoever. What you are about to witness is merely an illustration of a thought. Here’s the thought: I want to do serious server-side web development with JavaScript and Node.js. Why? Node.js is a convergence. The creation of Node.js was precipitated by several phenomena including the rise of [...]
Node.js and JSON Template : A delicious pairing
I recently blogged about the virtues of Node.js and my personal desire to use JavaScript on the server. Well, I decided to start putting the pieces together. First of all, every good web framework needs a template system. I found JSON Template, a simple enough template system written in JavaScript and intended for client-side HTML [...]
An Apology For JavaScript
JavaScript is an excellent programming language. As a language, its strength lies in the simplicity and regularity of its syntax. I’m going to show you how much simpler it is than even Python or Ruby. OK, here is how you define a function in JavaScript:
function hello(target) {
alert("Hello, " + target);
}
And here [...]
Grokking JavaScript Part 3 : Functions
In JavaScript functions are also objects, just like arrays are also objects. Functions, when treated like objects, act like objects. They exist as instances and are referenced from variable names or object properties which are also just references. Here is a simple, empty function assigned to a variable (reference).
var emptyfunc = function() {};
Now, this function [...]
Grokking JavaScript Part 2 : Simple Arrays
An array in Javascript is a superset of an object that contains an ordered list of references. Here is the simplest Javascript array imaginable:
[]
The references in an array are not named, so creating an array of (references to) values and assigning that to a reference (variable) is easy.
var myarray = [1,2,"3","four"];
Arrays elements can be referenced [...]
Grokking JavaScript Part 1 : Simple Objects
To understand JavaScript objects, you have to understand references. A variable in JavaScript is a reference to an object or a primitive value. Here is the declaration of a variable holding a numerical value:
var foo = 9;
JavaScript objects are very simple. Here is the simplest JavaScript object imaginable:
{}
JavaScript objects are maps, which is to say [...]