• Get a side job

    Wow, five months since my last update. Ok, a short explanation. First I went to a new position in my old company (kind of Devops) and then I left Starz to play a new song for a new company (say hi to TheMotion). Now it’s all about Docker, Python and...


  • Symbols in ES6

    Symbols are a new concept in ES6. Symbols are used to create unique identifiers. Curious thing about them: you can’t get the value of this identifiers. You can’t inspect them; the only think you can know is that they are unique. Let’s see an example: let deathSymbol = Symbol('Ank'); console.log(deathSymbol);...


  • Classes in ES6

    Classes in Javascript. Possibly the most controversial feature of Ecmascript 6. As someone say to me: “just syntactic sugar for making Java developers feel important when they deal with javascript”. Now, is that true? We have a full new syntax. Does it make something different? Short answer: it doesn’t seem...


  • Modules II: Functions

    In our previous post, I started the talk about modules. We know now how we can export variables in ES6. But, what about functions? Can’t we export functions in the module? Of course we can! Let’s see how we can do it: Ok, let’s check the code: index.html <html> <head>...


  • Modules I: Variables

    Ok, now that we have our boilerplate (see our previous post, we can start working with Modules. But first is first: what is a Module in ES6? Ok, we use modules to cut our code into chunks that make sense together. Think of different libraries, like jquery or google maps....


  • traceur & module loader boilerplate

    This will be a “just configuration” post. We are going to talk about some improvements in ES6 that has not been implemented yet in the browsers. So we need to use some polyfills to support them in browsers. To support you in an easy way, I have created a boiler...


  • Destructuring

    ES6 supports destructuring. With this feature we can extract values from data stored in arrays (including strings) and objects. How can we do that? Simple enough: Arrays let rankingOfQuidditchCupIn1992 = [ 'Ravenclaw', 'Gryffindor', 'Hufflepuff', 'Slythering' ] let [ champion, subchampion ] = rankingOfQuidditchCupIn1992; console.log(`The champion was ${champion}`); console.log(`The subchampion was...


  • ES2015 Literals (Octal, Binary and Template)

    In the new ES2015 we have new literal’s features. Today I will talk about two of this new improvements: the Octal and Binary literals and the Template literals. Octal and Binary literals Ok, this will be quick. Let’s check this: let answer = 0o52; console.log("What's the answer to universe?"); console.log("That's...


  • For-of loops

    This will be quick. At least we have a for ... of loop in Javascript. It is used in Iterables (we talk about them in a future post). But for know, look at this code: var mortalKombatCharacters = ["Sub-zero", "Scorpion", "Johhny Cage", "Shang Tsung", "Raiden", "Sonya Blade", "Liu Kang", "Goro"]...


  • Rest & Spread

    More cool things for ES2015! Today we will learn about the Rest and Spread operators in the new Javascript. Let’s start! REST With the rest syntax we can represent any number of parameters we use as an array. Let’s start with an example: var gremlinsFamily = function(father, ...children) { console.log("The...


  • Capture blocks code: the project

    Just a quick update to show you a new tool I’m working on. You may know the difficulties that every developer on linkedin: you can’t put a valid block of code because Linkedin doesn’t have styles for them. So you can only do two things: Put the code in cursive...


  • Default parameter in ES2015

    Ok this may be kind of absurd for many developers, but javascript didn’t have default parameters in functions. Our usual code usually includes something similar to this: var giveMeTheTrueNameOf = function(name) { name = name || "Superman"; switch(name) { case "Superman": return "Clark Kent"; break; case "Bruce Wayne": return "Batman";...


  • Arrow functions

    Oh dear! Arrow functions were one of the more controversial updates of the ECMA6. Or at least, one of the most popularized discussion. Are they Syntactic sugar or are they really useful? Spoiler: IMMO they are useful and have some things awesome, but you can convert your code in a...


  • Block scoping, let and const

    Hi all! I have started to learn ES2015 or ES6, the new & shinny version of Javascript. It has lots of improvements and I’ll use this blog to write about them for future reference. If you find this useful, then I will be glad :) Now, let’s go. Today I...


  • Memento pattern

    Today we will see the Memento pattern, one partially-unknown pattern that we can use to solve some problems in modern developments. But, first, what’s a Memento? Let’s check the dict: Memento: an object or item that serves to remind one of a person, past event, etc.; keepsake; souvenir. That’s a...


  • Flyweight pattern

    The Flyweight pattern starts with a very specific hypothesis: you can save memory by reusing identical data in multiple objects. This idea could be strange in a world with gbs of RAM; but in the last few years we are using ever growing interfaces, with more and more objects. Think...


  • Adapter pattern

    Another semi-unknown pattern (but still very used if you work with JQUERY) is the Adapter pattern. It is used to translate the properties and methods of one object (the interface) to another object. Why would we do that? Imagine you have an huge and complex system, and imagine that you...


  • Strategy pattern

    Strategy pattern is a interesting but barely used pattern. It allows us to define multiple algorithms and make them interchangeable. So the “client” always call the same function and it receives the same result, but with different codes. As always, it is more complicated explain it by regular words that...


  • Singleton pattern

    Oh my! I totally forgot this pattern, one of the most used in interviews :D With this pattern you can reduce the amount of instances of a particular object. You will use only one. And this one instance is called singleton. This pattern was usually used in the past but...


  • Recursion (Functional programming III)

    Recursion! This is a familiar face for everyone who learned computing in the 90s. At that time recursion was like the hoy grail and all teachers said that you must use it whenever possible. First time I used it on a real project (about 1999) I get a memory error...