Posts from — August 2009
JavaScript summed up #4: Namespaces
In currently popular versions of JavaScript, there’s no native concept of namspaces, like in C#, Java and Co.
But namespaces are important when it comes to larger applications and/or using third party code. You risk to have conflicts with other code (being it your own code or third party code) that is named the same. Unexpected behaviour, to say it politely, can be the result (apart from polluting the global namespace with a lot of variables is just not very nice…).
So we know we need a way to simulate namespaces in JavaScript, too.
August 27, 2009 1 Comment
JavaScript summed up #3: Type checking
Since JavaScript currently is a dynamically typed language, the topic of type checking is quite interesting. In certain situations it’s rather important to know of which type the object at hand really is.
Here, we have some dummy objects that we want to type-check:
var num = 12;
var string = "Hello World";
var array = [1,2,3];
var object = { firstProp: 1, secondProp: 2 };
function Car(){};
var car = new Car();
Let’s look at two different ways to check the type of an object.
August 20, 2009 2 Comments
JavaScript Information Visualization – Of Hypertrees and Graphs
I stumbled over a great toolkit for information visualization – written entirely in JavaScript with the <canvas> tag:
The smoothness of the animations and of course the dynamic laying out of the data given had impressed me quite a bit. Give it a try!
August 18, 2009 1 Comment
JavaScript summed up #2: Closures
Closures are a vital part of JavaScript’s dynamic nature. Without it, a lot of things would work totally different. Because of this significance, it’s important to thoroughly understand closures.
So, what _is_ a closure, really?
August 13, 2009 No Comments
JavaScript summed up #1: Functions
PREFACE: This is the first post in a series of posts about JavaScript. There’ll be roughly one post per week in the next couple of weeks (don’t ask me, yet, how many weeks I’m going to hang in there – a couple, at least!
.
The goal is to give a thorough overview of some important core aspects of the language – ranging from building blocks like closures to best practices like unit testing.
Honor to whom honor is due – I’ve not invented these concepts and best practices but learned them from some of the best – most notably folks like John Resig or Douglas Crockford.
The first post is about the concepts of “functions” in JavaScript.
[Read more →]
August 6, 2009 7 Comments




