On JavaScript libraries

Posted on Wed 21 June 2006

Intially meant as a comment on Andrea's blog, but worth a blog entry on its own!

Andrea talks about "JavaScript libraries" and why in his opinion they're not needed.

Actually, I don't really see the point about "libraries". This is more a discussion about "real JS" vs "make JS look like xxx" (replace "xxx" with your favorite language).

Libraries are units of reusability. I wrote lots of C/C++ code at a time where there was only the low-level "standard library", and can't tell how many times I rewrote or copy/pasted the code for linked list, dynamic array, etc.

More than avoiding reinventing the wheel again and again, libraries are really about providing higher-level abstractions. And a standard library allows everybody to use these abstractions as a common language to build the next level of abstractions, making them integrable in even larger pictures because being based on the same underlying structures.

This is one of the reasons of the success of Java: it's not only a language, but also a library that provides higher-level abstractions.

There is also a lot to say about libraries and communities: working together to define abstraction not only helps in achieving a good design, but also attracts experts in their fields, which is really needed for specialized areas like DHTML Ajax where gathering people that cumulate man-centuries of fight with browsers is invaluable.

JavaScript is a great language that was born naked and the current trend towards libraries is just an indicator of people's needs for a common set of higher-level abstractions. It's very unfortunate that more than 10 years were needed for that.

ApacheCon approaching

ApacheCon Dublin