Chrome dev tools deep dive : Elements


1. Search CTRL + F allows you to search for strings in the DOM but you can also search using CSS selectors and XPath expressions. 2. Color picker Ever wanted to figure out what colours exist on a web page? Or prefer some other colour format? Here comes the color picker: Shift click on the color … Continue reading Chrome dev tools deep dive : Elements

3 Ways to start using promises


Continuing from the previous post; lets dive into ways of using promises. First, some helper functions: 1. Pseudo-Observers This involves attaching several handlers to a single promise; all attached handlers are invoked once the promise resolves. I call this the 'pseudo-observer' pattern because each 'observer' gets invoked once (remember promises never leave their resolution state). This explains why promises can't … Continue reading 3 Ways to start using promises

Understanding Partial Application and Currying


In pure functional languages, functions are not 'invoked', rather a set of arguments is 'applied' to them. Now, if all the arguments are not passed in, then the function is being  'partially' applied. Partial application converts variadic functions (i.e. functions with multiple parameters) into functions of lesser arity by pre-specifying certain argument values.

The Immediately Invoked Function Expression


The Immediately Invoked Function Expression (IIFE, pronounced iffy) is a named/anonymous function expression that is executed immediately after its declaration. It typically involves appending the function invocation operator '()' to the end of a function expression; this triggers its immediate invocation. Some background The IIFE used to be wrongly regarded as a Self Invoked Anonymous Function (SIAF) until Ben … Continue reading The Immediately Invoked Function Expression

Understanding JavaScript Functions


JavaScript is a functional programming language and it is essential to truly understand functions to achieve mastery of the language. In JavaScript, functions are pretty much at the same level as objects: you can assign functions to variables, access function properties, pass them in as parameters to other functions or invoke them using the function operator.

Programming Language Type Systems II


Strong/weak typing describes the ease of mixing variables of different types in expressions. Strong typing does not imply static typing just as weak typing does not mean dynamic typing. To put it simply, if a programming language tries to interpret an expression containing variables of varying types at runtime (e.g. adding an int to a … Continue reading Programming Language Type Systems II

EmberJS: The Rant


So I started on EmberJS some time last year; after spending an inordinate amount of time trying to design a prototype with people located all across the world. Finally, after several dreary demanding iterations and lots of work, we finally agreed on an implementation. One of the dev members suggested using EmberJS or backbone. Based on his review, backbone … Continue reading EmberJS: The Rant

Static and Instance Methods in JavaScript


I thought I quite 'understood' inheritance in JavaScript until I got flummoxed while trying to test my understanding. The JS prototypical inheritance model is hugely different from the classical approaches of the languages I started out with; the only way to fix this that I know of is by writing code and after spending hours screaming at my console I finally saw the light Alhamdulilah.

The language series: JavaScript


I was pretty much amazed to see a JavaScript library for Arduino last year; it's common knowledge that the language powers uncountable web sites, mobile applications and even Windows 8 apps, but Arduino? Mind-blowing. The ever-growing need for powerful web experiences propels the adoption and development of this remarkable language.  JavaScript was influenced by C (syntax), Java … Continue reading The language series: JavaScript