Fork me on GitHub

Tag JavaScript

Why I Prefer MooTools over jQuery

I don't understand the hype behind jQuery, why is everyone so excited about it. I'm not. Let's go through the typical jQuery marketing bollocks(TM):

Prototype Inheritance in JavaScript

Old-school way how to handle inheritance in JavaScript is so-called prototype inheritance. A lot of people don't very understand how it actually works. This technique works only with objects, there isn't anything like classes.

Asynchronous Testing with Node.js

Do you remember projects when your tests run for 30 minutes or even an hour? I do, actually it's nearly turning into a standard. So when CI send you notification that something went wrong, you are already working on a new task, so you have to switch context to fix the stupid bug and then switch context back ... pretty annoying and distracting. Fortunatelly it doesn't have to be so slow, mainly in a web application when you can make a lot of code to run asynchronously since you are always waiting for database ...

My Node.js Projects

Minitest.js in action (it's using colours.js):

Why You Don't Need OOP in JavaScript (So Much)

After I did some research on OOP in JavaScript, I realized I don't need it so much. I'm used to do pretty much everything via OOP, since it's the way how Ruby, my primary language works. But JavaScript is different.

CommonJS Module System in Ruby

I really like the CommonJS module system, which is explicit, rather than implicit as Kernel#require in Ruby. So rather than putting everything into the global namespace, require in CommonJS simply returns an object which contains the stuff you explicitly exported from the required file. For example:

Prototype inheritance in JavaScript II

This article is an continuation of the Prototype Inheritance in JavaScript where I explained what is prototype and how the basics of prototype inheritance in JavaScript works. Today I'll go on with the new keyword and how to use the more advanced OOP techniques as super() etc.

Extending JS Prototypes in Non-Invasive Way

The most serious reason for not extending prototypes of things like Object or Array is that you'll break iterations. For example

Mixins in JavaScript

Thanks to JavaScript flexibility it's incredibly easy to use mixins:

About

RSS

All Posts JavaScript

Tags

GitHub projects

Twitter @botanicus

Recent Comments