7

I am considering using Dojo in some new projects (or at least including it),, Partially because of it's compatibility with Google Closure Compiler's Advanced mode which will (hopefully) entirely delete all unused code.

What would I lose? (besides familiarity with syntax)

(also, generally any tips on what is different would probably be helpful)

Community
  • 1
  • 1
700 Software
  • 85,281
  • 83
  • 234
  • 341
  • 5
    The jQuery's community is bigger than the Dojo one. I guess. (e.g. on StackOverflow there are 69k+ jQuery questions where Dojo has only 1200+) – Thomas Menga Mar 14 '11 at 19:43
  • 1
    I'm not sure I understand the purpose here. If you are converting so that you can use features in Dojo then great. However if you are converting solely because you want added compiler options I don't see the point... unless you are already squeezing every last byte out of your current apps... and saving a few extra bytes will save you $1,000's on your multi-millions of requests... – scunliffe Mar 14 '11 at 19:51
  • Partially, we don't want anyone to know what library we use. Also, we want them to know as little as possible on how we structure our code. If the whole thing wraps into a single JavaScript file, it would be better. Especially if it was even more difficult to know what is going on. @scunliffe – 700 Software Mar 14 '11 at 20:08
  • 1
    If someone really wants to know those things, they WILL be able to figure it out as long as you use client-side code. Compressing your javascript code just makes it a little harder, but by no means impossible. – Charles Boyung Mar 14 '11 at 20:13
  • @Charles: I know that there is no absolute solution. I just don't want to make it easy. We have come a long way and feel like we have a really good idea on how to design our work. Our primary concern is local competition. – 700 Software Mar 14 '11 at 20:18
  • 1
    @George but why? It will be pretty straight forward for someone to copy the way your site works even without ripping the code directly. If your JavaScript source is critical to turning a profit, you've got bigger problems than protecting it! – Hamish Mar 14 '11 at 20:22
  • 1
    As someone who has to deal with both I strongly suggest jQuery. I don't really have any major reasons that aren't listed, but if you are already comfortable with jQuery I'd stick with it. – Seth Mar 14 '11 at 20:26
  • For my 2 cents worth: I personally think that the Dojo widget set is a **lot** nicer than the jQuery UI widgets. I also have **huge** respect for the localization capabilities of Dojo. – Pointy Mar 14 '11 at 20:27
  • @Hamish *source is critical to turning a profit* It is not. *straight forward for someone to copy* It is not (at least it won't work). – 700 Software Mar 14 '11 at 20:32
  • 2
    @GeorgeBailey Security through obscurity is _NOT_ security. What's your website? I'll set up a clone of it by the end of the weekend. – Raynos Mar 14 '11 at 20:44
  • 1
    Also, @George Bailey (awesome username btw), think of it this way: if your think your code is worth $X, then you should expect that *anybody* trying to look at it is willing to spend $X to do so. You really can't hide your application design when it's written in JavaScript and delivered to user browsers. – Pointy Mar 14 '11 at 20:45
  • @Pointy you could bootstrap a compiler to language "Foo" in javascript then write the entire language in "Foo". If you make "Foo" really obscure then at least you can hide the code design completely. – Raynos Mar 14 '11 at 20:50
  • 1
    @Pointy: I appreciate everybody telling me not to waste time on this, but I feel that this will work very well for our setup. – 700 Software Mar 14 '11 at 21:42
  • @Raynos: It is not a website. It uses server-side code. I am not concerned about exact clones anyway because anybody using them would have to modify them to fit their purpose. – 700 Software Mar 14 '11 at 21:46
  • @George Bailey - It should be noted that any JavaScript generated or otherwise from any library that is sent to the browser is 100% transparent, copyable, and fully legible/"de-encryptable" by anyone with an interest. That said, use whichever JS library you are most comfortable and familiar with. The time savings for your development will pay off more than the idiosyncrasies of a particular library. – scunliffe Mar 14 '11 at 23:55
  • Depends a lot on what it is you want to do, and which extensions/plugins you would leverage from each community. Dojo does come packaged with utilities which not only call obfuscators but also optimize by concatenation and inlining. – peller Mar 15 '11 at 01:50

3 Answers3

9

I use jQuery myself, but to sum it up jQuery appears to be better documented and easier to do cool stuff "out of the box". Dojo appears to be easier to extend if you know what you are doing. I got this info from the community wiki here:

jQuery

  • Fast
  • Well documented
  • Easy to use
  • Chaining
  • Unlike Prototype it doesn't extend an object if you didn't specifically ask for it (try looping an array in Prototype)
  • easy-to-use Ajax (I love the $.ajaxSetup() function)
  • Nice event handlers
  • CSS selectors
  • filtering your selection
  • did I mention chaining?
  • Small (only 30 KB)
  • Nice little build-in effects.
  • Plugins

Dojo

"Being a Dojo developer I would recommend Dojo. While my choice is not surprising, I became a Dojo developer because I found following things, which are done better than in other JavaScript frameworks:"

  • OOP (and other paradigms) done right.
  • Widget infrastructure done right.
  • Modules done right with all necessary goodies:
    • Lazy loading of modules dynamically.
    • Possibility to extract only necessary modules and build a custom one-file profile.
    • Asynchronous loading of modules if desired.
    • Simple integration with CDNs for heavy-duty web applications.
  • Sheer breadth of available modules in DojoX including graphics, charting, grids, and so on.
  • Ability to use it in non-browser environments.
  • Attention to details in widgets:
    • support for i18n (including LTR and RTL languages),
    • support for l10n (including standard date, currency, number formatting),
    • provisions for people with special needs (automatic high-contrast mode, keyboard-only support, and so on) — useful for regular users too, and mandatory for most government contracts.
  • Smart people in the community (last but not least) — as much as I love hand-holding for novices at some point every developer becomes "seasoned" and needs much more than that.

"Smart people in the community (last but not least) — as much as I love hand-holding for novices at some point every developer becomes "seasoned" and needs much more than that. If all you want is to write one-liners and add simple progressive enhancements to existing web applications, you can do it with pretty much any framework, or even with a pure JavaScript. But as soon as your web application becomes bigger or more complex good packaging, good support for your favorite methodologies, good building blocks, and the ability to make your own building blocks become more and more important. That's why I settled on Dojo, and never looked back."

Community
  • 1
  • 1
themerlinproject
  • 3,542
  • 5
  • 37
  • 55
1

For what it's worth, the full source version of dojo comes with ShrinkSafe. I'm not familiar with any performance comparisons between that and the closure complier, but I find dojo's module management and packaging tools (including ShrinkSafe) to be very useful.

Chris
  • 6,805
  • 3
  • 35
  • 50
  • Dojo's community has generally shifted to Closure from its own Shrinksafe, which was one of the original obfuscators based on Rhino and perhaps the inspiration for YUI and Closure. Closure does have much more advanced features. At this time, I don't think running closure in advanced mode (pruning out dead code using hints, etc.) works OOTB, but someone is working on it. There's a thread about this on the dojo-contributors list (oops... I see you already referenced Stephen's work) – peller Mar 15 '11 at 01:45
-1

Well if I need to say some thing now I would say there is not a difference for me between jquery and dojo because I don't use both. I use pure javascript that i have gone deeper on it that I don't need any of the libraries I create my own framework my own things more fast, pure, cured,

And I would say I have hated all libraries cause it make me more unkowing of things like the wonder of javascript and its beauty.

I dont advise using any library and if you need so do it after you know javascript for real.

Peter Hosey
  • 95,783
  • 15
  • 211
  • 370
Marwan
  • 69
  • 1
  • 4
    I pushed the limits of animation before I used jQuery. I appreciate anybody who learns to do it manually and then later uses a framework. I would stress for someone to have a general idea of how the framework does the job but I would **not** say they should learn to do without the framework. – 700 Software Mar 15 '11 at 15:27
  • 4
    Vanilla Javascript _would_ be beautiful _if_ browsers implemented it uniformly. I'm a much happier person when a library is handling browser idiosyncrasies for me. – Chris Mar 15 '11 at 19:08