Durandal 2.0 folder structure and optimization

Folder Structure

Recently, before starting a Node.js (using Locomotive.js) and Durandal project, I searched the web for the optimal folder structure. I didn’t found nothing really useful so I decided to go on using the Durandal’s convention, separating views and viewmodels, in the public folder of the Node.js application. I ended up using the following structure:

  • App: the main folder of the Durandal application
    • views: HTML files of the application (V in MVC)
    • viewmodels: the business code …
Read More
JavaScript Closures


In this new post I’m going to talk about “closures”. Just like hoisting, closures are a key concept to JavaScript, since they allow to create functions that bind the variables within a scope. Closures are usually used to build callback functions.

A good definition is available on the Mozilla Developers Network website, on which this post is entirely based.

Closures are functions that refer to independent (free) variables. In other words, the function defined …

Read More
JavaScript Hoisting


In this post I am going to talk about JavaScript. Recently I rediscovered this programming language, after a long time distance caused mainly by its quirks. However while working on my thesis I started to enjoy this language and I realized how much powerful it can be, if used in the correct way.

“Do you want to work with the Web? Better learn JavaScript” said once a teacher of mine.

Therefore with a series of posts I’m going to analyze those little …

Read More