That overuseful little $

That overuseful little $


Folks,
My day job is writing server code for CircleShare (http://
circleshare.com). CircleShare is built on the lift web framework
(http://liftweb.net) I'm also the lead committer for the lift
project.
When the lift project started to look around for a default JavaScript
library, we were pointed to jQuery. I looked at jQuery and instantly
fell in love... and when I say love, I mean LOVE. jQuery feels so
right in a functional programming web framework (lift is built on
Scala.) I immediately replaced much of the Scriptaculous AJAX
infrastructure with jQuery. It all worked really, really well.
I had need for Drag and Drop and some other features in CircleShare
and started using some of the jQuery plugins as well as jQuery UI.
None of them satisfied the requirements (cross browser stability being
a key requirement.) So, I started mixing Scriptaculous back in... and
ran into a whole lot of issues with the '$'.
Yeah, I know about compatibility mode. Yeah, there're magic
(function($){...})(jQuery) ways of using $ without really using it.
Unfortunately, the $ is littered all over the plugins in the
repository in a way that does not work with compatibility mode. It
burned 2 days reading plugin code and trying to figure out which ones
were well behaved and which weren't and then figuring out a load order
such that the various JavaScript libraries that allowed all the
libraries to work together.
The net-net is that $ seems to be overused and, despite some excellent
jQuery efforts, results in incompatibilities.
jQuery is currently the default JavaScript library in lift and I
intend to keep it that way. However, users of lift may have corporate
standards that dictate the use of Scriptaculous, YUI, etc. I want to
make sure that they can use their existing JavaScript infrastructures
with lift-based projects. This does not mean replacing jQuery for the
AJAX/Comet plumbing, but it does mean seamless use of other JavaScript
libraries for whatever has been built in those libraries.
It seems to me that deprecating $ in jQuery might make things easier
from a namespace/compatibility standpoint. Also, in the nearer term,
making sure that all the plugins that jQuery hosts are '$' polite
would be a big help.
Thoughts? Flames? "We've had this discussion 85,000 times, go look
at the archives"?
Thanks,
David