barbarian meets coding

WebDev, UX & a Pinch of Fantasy

Functional Programming in JavaScript

| Comments

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.

Functions are one of the most foundational and common constructs in JavaScript. We use them for all kinds of things: to abstract, encapsulate and reuse functionality, as object factories and constructors, to simulate data privacy, to create namespaces and modules, we can compose them with other functions… They are everywhere.

The fact that functions are so prevalent in JavaScript, that they are first-class citizens and that it is very natural to use higher-order functions, makes JavaScript a great language to do functional style programming.

But what does all this nonsense of first class citizenship and higher-order functions means? Why should you care about functional programming in the first place? And moreover… What the heck is functional programming?

Barbaric Tip of the Week: How to Recover a Lost Commit With Git

| Comments

Barbaric Tip of the Week is a weekly series whose main purpose is to share tiny bits of knowledge that I find specially useful and interesting.

Last week I experienced one of the weirdest moments I have ever had with git and something that should never ever happen within the secure confines of a version control system: I lost a commit. My source code, everything that I had been working on for 3 hours wiped out from existence.

Has this ever happened to you? Would you like to know how you can recover a lost commit?

My Talk at Devsum 2016 and Some Interesting JavaScript Links

| Comments

Hi! Last week was intense!! I came back from spending a greeeeat long week in New York, powered through jet lag and a nasty cold and did my talk at Devsum 2016 about the mysterious, arcane and obscure art of JavaScript-mancy!

Devsum 2016

It was a ton of fun as usual. The conference was awesome, the organizers did a great job, everything ran super smoothly, the speakers were very kind and great to hang out with, the attendees were engaged and great to have a random conversation with here and there, and the people at Active Solution were a blast to be around. So thank you everyone for making it happen!

I think my talk went pretty well although perhaps there was a little bit too much information and speed towards the end. You’ll be able to be the judge of that because there’s going to be a recording coming out in the near future (which I am looking forward to watching myself by the way hehe).

Anyhow, here are my slides and a bunch of useful links that serve as a superb companion for the presentation.

Argument Destructuring and Type Annotations in TypeScript

| Comments

I often use destructuring in ES6 when I want to have a function with an options object. I described options objects in “More useful function patterns – function overloading as a way to achieve function overloading in JavaScript with the added benefits of named arguments and extensibility.

Recently I was trying to use the same pattern in TypeScript adding some type annotations but it did not work! If you have had the same issue yourself read through to find out how to solve it.

A Screenshot of me testing destructuring in TypeScript

A Look at ES6 Sets

| Comments

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.

A Set is a data structure that represents a distinct collection of items in which each item is unique and only appears once. If you have been working with JavaScript for a little while chances are that you have need to roll your own implementation of a Set. Well, you’ll need to do that no longer beause ES6 comes with a native Set implementation.

A Super Quick Summary of the NgConf 2016 Keynote on Angular 2

| Comments

Yesterday was the first day at ngconf 2016 with great announcements for Angular 2 and a lot of great talks all available for you to see and enjoy right now on youtube.

NgConf logo

I thought it would be nice to write a quick summary with some bullet points including the most interesting announcements from the keynote in case you don’t have 1 hour free to watch it yourself but can invest 2 minutes in reading an article.

Making a Game With Rx.js and Web Speech at Active Dublin 2016 - Part III

| Comments

In the previous articles of this series we have been building a game using Rx.js and Web Speech. We have followed, more or less, the same steps I took while I was at the JavaScript Wizardry contest at Active Solution Spring conference in Dublin.

If you have missed any of the previous articles don’t hesitate to go back and take a look from the beginning!

In this final issue we will complete our game by adding some excitement through the possibility of dying. We will also make the game more visually appealing with some styles and graphics, experiment with the Web Speech Synthesis API and we’ll wrap it up with a small reflection about the whole experience.

Making a Game With Rx.js and Web Speech at Active Dublin 2016 - Part II

| Comments

In the last article of the series we started building a game Rx.js and Web Speech just like I did at the JavaScript hackathon at Active Dublin 2016.

The game is a variation of the popular typing game where words fall off the screen and you need to type them before they get to you. The slight variation consists in changing the game mechanics from typing to speaking. In our game, letters will fall off the screen and the player will need to say a word starting with that letter to earn points, destroy the letter and avoid certain annihilation.

Say What Maddafakka Sketches

At the end of the last article we had completed the beginnings of a game with a beautiful black background and some letters falling off the screen. Let’s continue building our game by adding some player interaction through the Web Speech API!

Making a Game With Rx.js and Web Speech at Active Dublin 2016 - Part I

| Comments

Last week… or was it two weeks ago?… wo! Time flies!… Two weeks ago I was at Active Solution spring conference at Dublin. The topic of the conference was JavaScript (yippiii!) and we organized a hackathon for all employees to experiment with their JavaScript skills and build something cool over the weekend using music, sound or speech APIs.

It was a super fun experience and every team had something to show at the final reckoning in the demo sessions. My personal favorite (and the winner) was a virtual fly that sprang to life when you connected several devices together and started buzzing as it randomly flied through a crowded room to everyone’s delight (or almost everyone XD).

I, myself, worked as a coach during the Hackathon so I couldn’t fully participate with any team. I did sneak some hours though and attempted to build something cool with Rx.js and Web Speech.

This is the story of… Say What Maddafackaaaaaaa!! – The Game… Behold!!