Archive for the ‘Javascript’ Category

The Advancing PHP Developer Part 5: Design Patterns

Saturday, July 12th, 2008

5. Design Patterns

A design pattern is a general reusable solution to a recurring design problem in object-oriented systems. Design patterns are essentially blueprints that suggest how to solve a particular set of OO design problems while adhering to OO best good-practices (which I've recounted in my Object Oriented part of this series).

To explain by example, lets have a look at the Model-View-Controller pattern, a common pattern in use on the web and a source of much confusion amongst aspiring developers. The Model-View-Controller pattern (abbr. MVC) is a general solution for decoupling domain logic from the user interface, resulting in much better maintainability for both.
(more...)

HTML 5 shaping up nicely

Friday, June 20th, 2008

Left for dead by many, HTML resurfaced half a year ago when the w3 released a working draft for the next version of this markup language. The draft was recently updated and a document detailing the differences from the previous version was released as well.
(more...)

jQuery and Prototype the choice of top websites

Saturday, June 14th, 2008

Pingdom has complied a list of the Javascript frameworks used by the top sites on the web (top 100 in Alexa US, Webware's top 100 web apps). jQuery and Prototype are the top choices, getting 11 and 13 respectively.

It's interesting to note that Dojo is not even featured on this list, though if you check the comments you'll see that it is used partially at the apple site (in the apple store). This makes me wonder even more regarding Zend's latest decision to integrate Dojo into their framework. As I commented in that release statement (comment #6 is mine), I feel that Dojo isn't appropriate as the default for the framework as it is more complex and much less documented than the other top frameworks.

As a long time jQuery developer I have no intentions of integrating a new Javascript library into my development environment, so I'm obviously biased. I still feel as though Zend missed an opportunity here to better cater to the needs of a broader user base and instead chose to prioritize its partners best interests.

Semi-colon mystery explained, jQuery UI released

Wednesday, June 11th, 2008

Javascript is a very mysterious language. Its prototypical inheritance structure and its function == object == function concepts are quite different compared to standard OO languages. As I did with PHP, I try my best to learn best good practices by studying frameworks I like, and in Javascript's case that would be jQuery.

I had believed I figured out most of the conventions used in the jQuery source code, however a recent addition has been bugging me and I could not find a reasonable explanation for it - I'm talking about the mysterious semi-colons appearing at the beginning of some of the source files in the library. What is its purpose? Does it make the closure invisible to giant robots from outer space? I had no leads to go on.

This blog post by the jQuery.rule team however, reveals the truth about the semi-colon debacle - apparently they're used for safe file concatenation (string join). Well that's a load off my chest. You learn something new every day.

In related news, jQuery UI 1.5 has been officially released, says the jQuery enquirer. jQuery 1.5 is an extensive UI oriented extension to jQuery, and version 1.5 bring forth many improvements such as a tighter API, an effects library called enchant, a skinning mechanism and plenty of bug fixes. I'm just excited they finally updated their documentation, as I've been using it for a while going only by source code.

Almost useful IE replacement

Sunday, June 8th, 2008

I stumbled upon a tool by the name of IETester today, that is supposed to render websites in different IE engines from version 5.5 to 8 beta. It appears to be working quite well, allowing to open multiple tabs of different IE versions. Unfortunately its Javascript support is too limited to be of real use for serious application development.

Still, a nice tool for web designers wishing to test their HTML and CSS layouts against several generations of IE, without having to resort to hacking multiple installations of different versions (such as multipleIE).

IETester [via LifeHacker]