Barbarian Meets Coding Titlebarbarianmeetscoding

WebDev, UX & a Pinch of Fantasy

15 minutes readoop

White Tower Summoning Enhanced: The Marvels of ES6 Classes

The Mastering the Arcane Art of JavaScript-mancy series are my humble attempt at bringing my love for JavaScript to all other C# developers that haven’t yet discovered how awesome this language and its whole ecosystem are. These articles are excerpts of the super duper awesome JavaScript-Mancy book a compendium of all things JavaScript for C# developers.

In the last article you learned how to implement classes in JavaScript without relying in ES6 classes which puts you in a prime position to learn ES6 classes:

  1. Now you have a deep understanding about the underlying implementation of ES6 classes which are just syntactic sugar over constructor functions and prototypes. This will not only help you understand how ES6 classes work but also how they relate to the rest of JavaScript.
  2. You appreciated how you needed to write a lot of boilerplate code to achieve the equivalent of both classes and classical inheritance. With this context the value proposition of ES6 classes becomes very clear as they bring a much nicer syntax and developer experience to using classes and classical inheritance in JavaScript.

In any case, ES6 classes are great for developers that are coming to JavaScript from a static typed language like C# because they offer a perfect entry point into the language. You can start using classes just like you’d do in C#, and little by little learn more about the specific capabilities of JavaScript.

Behold! ES6 classes!

Read on →
1 minute readdev-talk-monday

Dev Talk Wednesday: Be More Productive With Visual Studio Code With These Coding Quick Tips Series

Dev Talk Monday is the series that brings you awesome dev talks every Monday… or Wednesday XD

This dev talk wednesday goodness is dedicated to making you more productive with Visual Studio Code! Andreas Wänqvist has started a new series of short videos devoted to just that:

Makes you want to get started using Visual Studio Code, doesn’t it?

He has another great video about how to get started with Visual Studio Code and ASP.NET 5, go check it out! You can follow his excellent articles about TypeScript at his blog and on the twitterverse.

I also hear there are more videos on the way… :)

28 minutes readoop

White Tower Summoning: Mimicking C# Classical Inheritance in JavaScript

The Mastering the Arcane Art of JavaScript-mancy series are my humble attempt at bringing my love for JavaScript to all other C# developers that haven’t yet discovered how awesome this language and its whole ecosystem are. These articles are excerpts of the super duper awesome JavaScript-Mancy book a compendium of all things JavaScript for C# developers.

In this article we are going to take a deep-dive into how to emulate classical inheritance in JavaScript and get to the nearest equivalent to what you are accustomed to in C#. We will focus in the alternatives we had prior to ES6 classes so that you can work with classes even if you are stuck in ES5 and so that you can understand the underlying implementation of ES6 classes which are just syntactic sugar over the JavaScript prototypical inheritance model.

Read on →
11 minutes readoop

Summoning Fundamentals: A Three Part Introduction to OOP in JavaScript for C# Developers - III - Polymorphism

The Mastering the Arcane Art of JavaScript-mancy series are my humble attempt at bringing my love for JavaScript to all other C# developers that haven’t yet discovered how awesome this language and its whole ecosystem are. These articles are excerpts of the super duper awesome JavaScript-Mancy book a compendium of all things JavaScript for C# developers.

In the last two chapters of these OOP mini-series we discussed the pillars of OOP in JavaScript - encapsulation, information hiding and inheritance - and how they differ from what we are accustomed to in C#. In this last chapter we discuss polymorphism and how JavaScript makes it dead simple with the concept of duck typing.

Read on →
20 minutes readoop

Summoning Fundamentals: A Three Part Introduction to OOP in JavaScript - II - Prototypical Inheritance

The Mastering the Arcane Art of JavaScript-mancy series are my humble attempt at bringing my love for JavaScript to all other C# developers that haven’t yet discovered how awesome this language and its whole ecosystem are. These articles are excerpts of the super duper awesome JavaScript-Mancy book a compendium of all things JavaScript for C# developers.

Thus far you’ve seen how we can achieve encapsulation in JavaScript by using either object initializers or constructor functions with the new operator. You have also learned how to attain data hiding through both closures and ES6 symbols. The next step is inheritance !

Read on →