2010.09.30

There is no spoon

The main reason for writing this post is that developers usually have some kind of bias against other programming languages or workflows, specially against those that they don’t know/understand/use… it’s always the same debate: dynamic against strict, strong-typed against loosely-typed, compiled vs. processed, sexy, powerful, expressive, safe, fast, etc..
Read more…


2010.09.28

The lost art of delegating click events on the iPhone

Today I saw on Peter-Paul Koch blog that event delegation for click events on <div> elements doesn’t work properly on the iPhone. Strangely enough, I’ve implemented it 4 days ago (as you can see on this commit) without ever experiencing any kind of problem, that made me insanely curious/scared, specially since I wasn’t doing anything special/different than him and I couldn’t understand what I was doing right/wrong…
Read more…


2010.08.29

Fast Duff’s Device

This week I’ve sent some links about common techniques to improve code performance to the FlashCodersNY mailing list and after sending a link about the Duff’s Device and the Fast Duff’s Device I got really curious if the performance could be improved with simple changes so I decided to do some benchmarks…
Read more…


2010.08.19

Stop writing plugins, start writing components

Why the fuck is that a jQuery Plugin?I’ve been doing a lot of JavaScript development lately and one thing that always bothered me is that most of the people misunderstand the plugin concept and uses it on the wrong way. In my opinion, the main reason is because JavaScript frameworks/libraries like jQuery, Mootools, Prototype.js and blog/CMS systems like WordPress, Joomla, Drupal encourages plugin development… – Let’s start with the basics…

What is a plug-in?

In computing, a plug-in is a set of software components that adds specific capabilities to a larger software application. If supported, plug-ins enable customizing the functionality of an application. For example, plug-ins are commonly used in web browsers to play video, scan for viruses, and display new file types. (source: Wikipedia)

What is a component?

A component in the Unified Modeling Language “represents a modular part of a system, that encapsulates its content and whose manifestation is replaceable within its environment. A component defines its behavior in terms of provided and required interfaces” (source: Wikipedia)

Read more…


2010.08.08

Canvas Method Chaining

This week I’ve done some stuff using the HTML5 canvas and one feature that I kind missed was method chaining, so I decided to implement it…

It isn’t something ground-breaking - other people done it before (Canto.js, MDC canvas, p01, …) - but I decided to implement it by myself since it’s something simple, the other solutions are way more complex than what I needed, source code isn’t that clean and/or overwrites native objects prototypes (possibly causing conflicts/issues), etc…

I’ve released the code as open source under the WTFPL and it is available on GitHub.

Check the project page on GitHub for more details.

I hope it is useful for someone.

PS: I’m not a big fan of method chaining since code tends to be become “more cryptic” but sometimes it makes sense to use, use it with moderation!