Revenge of the $

There was a lot of talk on namespaces, and conflicts with the $ function. This problem is made worse in the JavaScript world due to the fact that you have to ship the JS that your app needs each time. Practicalities mean that a lot of developers have build tools that generate a minified js […]

Share online:

There was a lot of talk on namespaces, and conflicts with the $ function.

This problem is made worse in the JavaScript world due to the fact that you have to ship the JS that your app needs each time. Practicalities mean that a lot of developers have build tools that generate a minified js file. One big file. One download.

This has lead to years of copy 'n paste reuse. I have seen people take the $ function from Prototype and put it in their own helpers.js file.

If we could declare standard libraries and have them cached in the browser nicely we wouldn't have this problem:

  • import dojo.foo v2.1
  • import openajax.$ v3.0

We could standardize $ and keep it simple.

About The Author

Deepak Gupta is a IT & Web Consultant. He is the founder and CEO of diTii.com & DIT Technologies, where he's engaged in providing Technology Consultancy, Design and Development of Desktop, Web and Mobile applications using various tools and softwares. Sign-up for the Email for daily updates. Google+ Profile.