LooselyTyped

(map blog thoughts)

May 31, 2013 - Lifehacks

On the road to learning - Part I

We, as developers, live and thrive in an industry which not only sees its languages, tools, and techniques change every few years, but one that also regularly experiences tectonic shifts in the very paradigms upon which these tools are built! From desktop to web to mobile, from object-oriented to functional programming, we are not only expected to keep abreast of these changes, but also be proficient in them. How can we keep up? How can we best leverage our time to learn and retain knowledge effectively? In this article, we will consider a few strategies to help align ourselves with being a better student, and we’ll also take a look at some tools and techniques that can make our learning more meaningful, insightful, and long-lasting.

Aug 22, 2012 - JavaScript

On Prototypal Inheritance - Part II

In the first installment of this series, we discussed objects and functions in JavaScript. In this second, and final, installment in this series, we will go a bit further and see how functions are used as “instance factories” or constructors to create objects. We will see how we can use these “constructors” to not only instantiate new instances, but also endow new objects with a predefined set of properties applicable to that “class” of objects (much like Java classes). Finally, we will put it all together to build our own hierarchy. We will also see some potential potholes and how to avoid them in your code.

Aug 18, 2012 - JavaScript

On Prototypal Inheritance

Douglas Crockford refers to JavaScript as “Lisp in C’s Clothing” which gives us an inkling to it’s true power. Unfortunately JavaScript, a language that started with a rushed schedule to production and a specification that was buffeted with strong political winds at it’s inception, has often been “misunderstood”. Despite it’s unfortunate beginnings, amidst the stormy waters laden with many a pitfall like global variables, lie a few pearls of wisdom, of which one is prototypal inheritance. In this 2-series article we will take a deep dive into JavaScript’s prototypal nature - we will see how it works, and more importantly how we, as JavaScript developers can leverage it. We will take it a step further to see how we can develop our own hierarchies to model our code, allowing for better reuse.