Rock’n The Web With Libraries

Ajax Dart Board

Ajax Dart Board

If you’re a developer and you’ve not been hiding in a rabbit hole for the past 3 years then you’d be familiar with the buzz words of our today : ajax, social, user experience etc, these are all powered by Web 2.0, another loose term used to describe the “new wave” in web development, a paradigm long overdue.

The web has witnessed tremendous growth, from the gory days of the browser wars to the several W3C standards c’tees often dashing our hopes with standards that were either not adopted or poorly implemented by vendors, through to the proliferation of glorified hacks by developers or their numerous communities, all attempts to fix the web and make it a more robust platform. All these good-bad-and-ugly has led us to where we are today, and I can say (with hind sight) that happy days are here again.

Today, we develop with superb IDE’s and powerful frameworks / libraries that have abstractions that normalize browser differences and put in our hands the requisite tools to build today’s mission critical apps. We really don’t have to debate over the significance of a library, especially since we must deliver critical functionality packaged with unobtrusive but intuitive and responsive UI. This is made even daunting by the fact that user experience or expectation evolves, just as Eddie Murphy’s Coming To America don’t stand a chance with Dan Brown’s Angels & Demons as best movie of the year (2009), so does HiFive (by several opinions) not stand a chance with the Google Docs or Facebook or our day. The reason is simple and short, these recent expressions of ingenuity have raised the bar and pushed user expectation on deliverables even deeper, forcing the art of creativity (including web development) to be more involved.

The issue now is making the case for the library of choice, and for Ajax today, this judgment call is difficult without a bias, trust me!

Ok, some of the factors to consider include : functionality (of course), stability, documentation, collaboration / support, ease of use / development and very importantly, extensibility. For me, the case is settled, it’s JQuery for sites and site-like apps and ExtJS for true Web 2.0 webapps, especially those that have to look and behave like desktop apps.

Though I’ve not forgotten my first love, YUI especially for the new YUI 3.x ecosystem, but JQuery and ExtJS has me bound ball n’ chain.

JQuery’s tiny footprint, ease of development and superb pluggability is a bait you’d be willing to take, and by any standard, Ext’s just blows you away with their gorgeous UI, look-and-feel, and widgets, and a very solid and carefully designed component architecture, on which tomorrows demanding apps can thrive.

When it’s time to make your judgment call, do make an informed one. Cheers.


The Case For Another Google Chrome

Google Chrome OS

Google Chrome OS

Google Chrome has always been a little more than a browser: it’s optimized for running web applications, each tab runs as a separate process, the interface is minimalistic and there’s even a task manager. “We realized that the web had evolved from mainly simple text pages to rich, interactive applications and that we needed to completely rethink the browser. What we really needed was not just a browser, but also a modern platform for web pages and applications, and that’s what we set out to build,” said Google in September 2008.

Google’s recently announced a natural extension of the Chrome project: an operating system for netbooks. “Google Chrome OS is an open source, lightweight operating system that will initially be targeted at netbooks. Later this year we will open-source its code, and netbooks running Google Chrome OS will be available for consumers in the second half of 2010. (…) Google Chrome OS will run on both x86 as well as ARM chips and we are working with multiple OEMs to bring a number of netbooks to market next year. The software architecture is simple — Google Chrome running within a new windowing system on top of a Linux kernel.”

As people use more and more web applications, the operating system becomes less important and it makes no sense to pay for it. The desktop mail client could be replaced by Gmail, the calendaring application could be replaced by Google Calendar, the office suite has lightweight alternatives: Google Docs and Zoho, it makes more sense to use an online feed reader like Google Reader, your scientific calculator is less powerful than Wolfram Alpha and you’ll rarely need a video player when you have YouTube, Hulu and other video sites.

Another open source OS built on the linux kernel is certainly welcome by me, but the approach of browser as the driving force for the OS usage / interaction, though interesting, would be very involved, and I hope we won’t be giving hackers a lifetime party :)


Active Record vs Data Mapper

I think one problem is that many people’s experience with ORM is limited to Active Record implementations. Unfortunately, the more complex and properly normalized your data model is, the less likely Active Record will do what you need.

Data Mapper type ORMs (most notably Hibernate for Java, and SQLAlchemy for Python) offer a great bridge between OO and SQL that can handle just about anything you throw at them, including many-to-many relationships, inheritance chains, and even seamless database sharding. These more advanced ORMs also offer the ability to use hand-written SQL whenever needed, so you can fine-tune queries that need better performance.

I don’t know of any established Data Mapper packages for PHP, but at least one is in the works: http://phpdatamapper.com/

Hibernate and SQLAlchemy also offer a full set of DB independent SQL generation functions, but I find that DB independence is a myth and usually not needed anyway (How many projects switch their database?). Most complex databases will have triggers, functions, and sometimes custom data types, and there won’t be abstraction layers that can deal with those differences anytime soon.


Help build a better PHP IDE!

PHP Hypertext PreprocessorThere’s been a fair bit of talk about PHP IDE’s of late. That’s not surprising given how useful they can be. (Really, folks, vi can only take you so far.) Most of the attention has been focused on the big boys: Eclipse and its derivatives like Zend Studio (both free and commercial), Komodo, and NetBeans. Eclipse and NetBeans are both Java based, and Komodo is based on Mozilla’s XUL platform (which also runs Firefox and company). I’ve been bouncing between them for a while, and haven’t really been satisfied with any of them. I usually refer to Eclipse as the one I hate least. :-)

There’s a new contender to keep an eye on, though, that is worthy of notice: KDevelop.


JavaScript UUID



UUID (Universally Unique Identifier) is standard (part of ISO/IEC 11578:1996) to create “universally unique” identifiers to identify objects within a system or across system boundaries. The identifiers are 128-bit in length (that’s 16 bytes) and while there really is no way to guarantee global uniqueness the probability of colissions are very small both thanks to the number of bits and the way the identifiers are created.

The number of theoretically possible UUIDs is 216 × 8 = 2128 = 25616 or about 3.4 × 1038. This means that 1 trillion UUIDs would have to be created every nanosecond for slightly more than 10 billion years to exhaust the number of UUIDs.

In its canonical form, a UUID consists of 32 hexadecimal digits, displayed in 5 groups separated by hyphens, in the form 8-4-4-4-12 for a total of 36 characters (32 digits and 4 ‘-’).

For example: 550e8400-e29b-41d4-a716-446655440000.

The UUID generation algorithms are specified in RFC4122 and several implementations exists for version 1 which is time based UUID, version 4 which is truly psuedo random UUID and version 3 and 5 which are named based UUID, using either MD5 (version 3) or SHA-1 (version 5).

In case you are interested in generating such UUID’s, but in the client with javascript, Math.uuid.js is the solution, it supports RFC 4122-compliant UUIDs (or GUIDS)as well as non-standard random IDs of arbitrary length and radix. For examples of the types of IDs it can generate, or to see performance data, check out the Math.uuid.js Test page.

The practice is probably a little different. The uniqueness depends on how random the numbers generated by Math.random() are. Generating truly random numbers is a notoriously tricky problem, solved in different (imperfect) ways across browser platforms and OSes. It’s difficult to say for sure what the real-world uniqueness of these numbers ends up being, but I suspect it’s more than sufficient for most purposes. Regardless, this is a weakness that all javascript UUID generators will be subject to, unless they rely on an externally-provided unique value. For example, one could use AJAX to fetch UUIDs generated by a site like http://www.uuidgenerator.com/, but that has it’s own set of issues.


A New Fox In The Wild

It is great to feel the good vibes at Mozilla HQ today as they launch Firefox 3.5! It is always an interesting ride to see a browser develop, and realize how complex and large the work is.

Congrats to the browser developers out there who are working hard to make the Web better. With final versions of Firefox 3.5, Safari 4, and Chrome 2 out in the wild…. things are picking up nicely.

The Firefox 3.5 release is exciting for me because it really benefits the developers. We get Open Video, @font-face, cross site XHR, Geo Location APIs, CSS Media Queries, Native JSON, Offline support, Web Workers, and so much more.

And, the world keeps moving. I have seen some very cool things in the nightly tree, and look forward to beign around as the team works on the next great Firefox.

Steve Souders has posted on Firefox 3.5 getting 10 out of 11 in his UA Profiler tests.

Watch the downloads come in with this cool download tracker that uses Canvas and SVG, all thanks to Justin Scott. The stats so far show that if the current rate trends hold we will beat the Firefox 3.0 download day, which is a surprise to all.

Sean Martell has created a nice wallpaper to commemorate!


Polluted Javascript Namespaces

I quite agree that a great deal of development time can be saved (or gained if you prefer) by using a javascript library for any substantial Web 2.0 project, but I must say that some of these libraries are not fostering (at least not as of this writing) collaboration amongst themselves by conflicting on the global namespace.

Because we are building mashups and social apps today we will always have need to use two or more libraries at the same time in a project to achieve our feats. I once had a project built on JQuery and used a particular Mootools plugin throughout, and then came a page where I needed to use a Prototype plugin and I got disaster. JQuery, Mootools, and Prototype all use the $ (dollar) smybol to denote their global namespace. They never envisaged a very likely scenario as this ??.

Ok, JQuery has been proactive with JQuery.noConflict(), what about MooTools and Prototype, I think it’s high time we got a solution to this.

April 2014
« Jul    



Twitter Updates

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

RSS Ajaxian Jobs

  • An error has occurred; the feed is probably down. Try again later.

RSS Ext Js Jobs

  • An error has occurred; the feed is probably down. Try again later.


Get every new post delivered to your Inbox.