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

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!


2010.07.21

HTML5 overview

Just did a presentation about HTML5 for my co-workers at Firstborn and here are the slides:


(Link to the presentation: http://tinyurl.com/html5-overview)

I hope it’s useful for someone.

PS: don’t get mad with me because of the Flash comparisons, I like HTML way more than Flash but for interactive/multimedia stuff, Flash is usually a better tool – I don’t want to start a war.


2010.07.06

Always comment weird things!

This is more a reminder to myself than anything else. It’s about something simple that I’ve been trying to do since a long time and that I hope most people been doing it too…

Always, I’ve said ALWAYS, comment things that may be strange to other developers (or even to yourself in the future) and/or fixes specific bugs, it can save you a lot of time…

Why

  • Because the code may need to be updated later.
  • You may forget why/how you have done something (or maybe why you have not).
  • Someone may get confused and fix something that wasn’t broken. (imagine re-opening a project after 1-2 years)
  • It can save you a lot of time.
  • It can be used as a reference on future projects.
  • People may learn from your source code (including yourself).

Read more…