2010.10.04

The performance dogma

On the past couple years I’ve been noticing that the web community (specially front-end devs) started to become more interested and to care way more about performance, trying to make applications load and execute as fast as possible. I think it was mostly influenced by Steve Souders High Performance Website and Yahoo’s Performance Rules.

Performance is a very important topic, which can directly influence the success/fail of an application, but I do believe that some people are getting things wrong and exaggerating a little bit (including myself)… – Of course everybody wants their applications to run and load as fast as possible but “optimizing” things without need is simply wrong. A common quote about performance explain this:

We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%. A good programmer will not be lulled into complacency by such reasoning, he will be wise to look carefully at the critical code; but only after that code has been identified” – Donald Knuth

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.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…


2010.06.17

How I structure CSS files

Yesterday I was having dinner with my coworkers (company party!!) and between some bottles of wine, Italian food and Bocce, Marcus Schaefer commented that my CSS are really organized and I briefly explained why I do this way to him and thought that it was a good subject for a blog post…

The purpose of this post is to explain a little bit my workflow and how I setup my CSS files and why I do this way. I’ve been using almost the same structure on the past 3-4 years and it has been working pretty well, it’s the way that I find more productive/organized for my way-of-thinking/workflow and I’ve never seen someone writing about and/or using the same approach.

Keep in mind: each person has their own opinions/preferences and my setup may not fit other people’s workflows…

Read more…