having fun with code

Tag Archives: instance

Finally: Singletons, the Mootools way

I have been using for a while the “new new Class” syntax to create singletons on the projects I am working on. This is for many reasons, but specially because I didn’t like other solutions like Class.Mutators, Class.Oclude or extending a plain object with $extend(). Now, after discussing a little bit on the Mootools email [...]

Sending messages between Javascript objects

When applications (or websites) get pretty big, it usually happens that a lot of different objects or classes interact with each other or, even worst, depend on each other to achieve the site functionality. A simple example could be a Tabs manager class, which controls a set of tabs in the page. Sometimes, the content [...]

Setting up timers and intervals inside JS objects

It may seem trivial but it has its tricky point. Usually, in procedural Javascript (this is, non object oriented programming), timers are set up passing the callback function on a string: function hello() {   alert("hello"); } // Will execute hello() after 10 seconds setTimeout('hello()', 10000); For this code to work, hello() has to be [...]

About the blog

This is a blog about development, focused mainly on Javascript but also other languages like python, shell scripts and more.

About the author

Eneko Alonso is a software engineer and UI developer with more than eight years of experience in software and web development. He lives in San Luis Obispo, California and works at LEVEL Studios.

Contact Info

Contact Info