The JS Event Loop

Asynchronous events and non-blocking I/O

Jessica O'Brien
November 01, 2015

Node is a JavaScript interpreter for running apps outside the browser (like on a server, for example). It uses non-blocking I/O and asynchronous events, and each module is created within its own filed with an isolated scope. These are fundamental concepts to understand before being able to make Node interpretation work in the intended way, so . . .

Read More

Recursive Backtracking

Jessica O'Brien
October 26, 2015

To put it simply, the idea behind backtracking comes down to trial and error. If you can't think of a way to jump to finding the solution to a problem, there is always the strategy of just trying different things until one of them works. When you search for a solution, try a possibility; if you find yourself stuck, back up and try the . . .

Read More

Pseudoclassical vs. Prototypal: JavaScript allows both

Jessica O'Brien
October 05, 2015

There are two broad types of inheritance in programming: protoypal and classical. Prototypal just means that objects can inherit directly other objects, while classical involves objects being instances of classes, and subclasses inheriting from superclasses.

Pseudoclassical Inheritance

This type of object inheritance uses:
. . .

Read More

Staying DRY

Jessica O'Brien
October 01, 2015

One of the first things we learnt at university was to scan through our code at intervals to see if several parts share similarities and factor out the shared aspects into its own container of reusable code. This follows the DRY principle (i.e.'don't repeat yourself') and is a key principle any software developer must understand:

. . .

Read More

'This' can be confusing

Jessica O'Brien
October 01, 2015

The keyword this is something I have found confusing from the get-go. Often it just doesn't seem to follow an intuitive pattern. For starters, this isn't necessarily bound to the function it appears within - just like any function argument, it could have a different binding each time the function is run.
There are only five ways . . .

Read More

{Object or Scope?}

Jessica O'Brien
September 30, 2015

Although both objects and scopes look quite similar and are both collections of key/value pairs, they are very different and don't actually overlap.
To add a variable to a scope, you have two options:
1. Set a new variable to an initial value all in one line:

var aPerson = {name: "jess"};
  1. Make a . . .

Read More

Execution Contexts

Jessica O'Brien
September 29, 2015

When a program runs, it builds up storage systems for holding variables and their values. These in-memory scope structures are referred to as 'execution contexts'.
These scopes differ to the lexical scopes in that they are built as the code executes (rather than as the code is typed). The rules surrounding in-memory scopes define . . .

Read More

Archive
   Subscribe by email and never miss a post.

This update link alerts you to new Silvrback admin blog posts. A green bubble beside the link indicates a new post. Click the link to the admin blog and the bubble disappears.

Got It!