Thursday, July 22nd, 2010

Dojo 1.5 is Out and it’s Feature Packed!

Category: Dojo

<p>The Dojo project continues to pump out goodness announcing version 1.5 of the Dojo Toolkit with a number of new and exciting features.

Dylan Schiemann had this to say about the release:

The JavaScript world is evolving at an intense pace. We’re very pleased with this release of Dojo, which offers the stability needed for existing apps and browsers, while introducing some of the capabilities of building great apps of the future.

Some of the biggest updates came to the Dijit UI library with the addition of the new Claro theme which helps provide a nice desktop look-and-feel to web applications as well as improvements to the charting and drawing components of the library.

And Dojo team lead Pete Higgins added:

If you haven’t seen the new theme Claro, you should. Julie Santilli and her awesome design team at IBM put some incredible design and style on top of an already stable and accessible UI library

The theme is incredibly clean. Check out some of the controls styled using Claro:




Other important updates include:

In addition, new initiatives are underway to provide solutions for the ever-growing and important mobile space:

This release continues the project’s philosophy of modularity allowing developers to leverage the library for anything from simple DOM manipulation to full-blown RIA development. Dojo 1.5 is immediately available for download and sports impressive, updated documentation to get you started quickly.

Posted by Rey Bango at 1:06 pm
60 Comments

+++--
3 rating from 6 votes

60 Comments

TrackBack URI

Woo! Great job Dojo team. Really love the new Claro theme. Huge improvement over the older ones.

Comment by kylehayes — July 22, 2010

Long live dojo.isArray!


dojo.isArray = function(/*anything*/ it){
// summary:
// Return true if it is an Array.
// Does not work on Arrays created in other windows.
return it && (it instanceof Array || typeof it == "array"); // Boolean
}

I also the code now beings with an empty statement, ; and has switched from spaces to tabs.

Comment by dhtmlkitchen — July 22, 2010

Looks like a very solid release, I’m gonna check it out, thanks for the heads up.

Comment by iliad — July 22, 2010

This is solid. I’ve used jQuery for many projects, but now I’m going to give Dojo a try. I especially like the work on the mobile side…well timed.

Comment by somethingkindawierd — July 22, 2010

@dhtmlkitchen

That’s them all over. And the sad thing is that they’ve been told repeatedly that the code is gibberish, but they want to be “shown where it fails”. Even worse, that function is called by most of their “modules”.

Lacking understanding leaves only observation and guesswork.

Comment by DavidMark — July 22, 2010

W00t! Congrats everyone on getting this out.

Best,
Brad

Comment by Brad Neuberg — July 22, 2010

@david – Funny how you think this is a lame blog full of lame people, but you’re always here to tell everyone how much they suck…

Comment by sixtyseconds — July 22, 2010

Claro looks great, well done!!

Comment by Les — July 22, 2010

Actually I’m more impressed that the Widget system has matured a lot to being where ExtJS was before, appearance wise. Of course Dojo’s Widget syntax is more declarative which is easier to write.

Comment by Jordan1 — July 22, 2010

Hmmm, since when did typeof ever return “array”??

Comment by rasmusfl0e — July 22, 2010

@dojo – I dig the pretty.
.
I didn’t see an indeterminate checkbox state for the themes. Does Dojo support that?
.
I noticed other non-Claro themes had css-sprite issues with some of the icons (exposing parts of other icons to the left)
.
I dig that keyboard navigation works and the combo button+dropdown is hawtt.
.
Also your RTL and High Contrast theme option takes it to a whole ‘nother level (though I had a hard time distinguishing between active and disabled buttons).
.
@rasmusfl0e – Since never. It’s a minor oversight on their end.

Comment by jdalton — July 23, 2010

I think the check is more of a future-proof way of detecting for arrays if they ever get implemented in that way. It’s probably a worthwhile extra few characters for future compatibility. David Mark would be proud.

Comment by SlexAxton — July 23, 2010

David Mark, I am surprised you have time to come here and comment. You should instead invest your time beefing up the UI library for your floundering js lib. I mean your current offering consists of this ‘stunning’ tabbed pane http://tinyurl.com/2fsyys7. Says it all really.

Comment by SteveFDotNet — July 23, 2010

SlexAxton: While that typeof it == "array" isn’t doing any active harm, it is utterly pointless whichever way you look at it. typeof is not going to be returning “array” in any environment for anything any time soon, or most likely, ever.

Comment by timdown — July 23, 2010

SteveFDotNet: What exactly is wrong with that tabbed pane?

Comment by timdown — July 23, 2010

@sixtyseconds

“Funny how you think this is a lame blog full of lame people, but you’re always here to tell everyone how much they suck…”

Always here? How did you arrive at that? It would be more accurate to say that I am never here, unless directed to a point of interest by somebody who does read this rag regularly.

@SteveFDotNet (do any of these people have real names?)

David Mark, I am surprised you have time to come here and comment. You should instead invest your time beefing up the UI library for your floundering js lib. I mean your current offering consists of this ’stunning’ tabbed pane http://tinyurl.com/2fsyys7. Says it all really.

I’ll tell you what that quote says: “you are an imbecile”. You linked to a lone user submission instead of the Examples page. Who do you think you are kidding? And how ignorant would you have to be to describe My Library as “floundering”. Yeah, it’s floundering so bad that I haven’t had to make adjustments for any new browser released in the last few years. That’s called resilience. ;)

Clearly you are saw some Dojo demos and coveted their “pretty” widgets. Sorry to break your heart. :)

http://www.cinsoft.net/mylib-examples.html

@StexAxton

I think the check is more of a future-proof way of detecting for arrays if they ever get implemented in that way. It’s probably a worthwhile extra few characters for future compatibility. David Mark would be proud.

LOL. Don’t bet on it. See my previous comment. If you aren’t aware, I rewrote that function (and the rest of their crap) a year back. They decided to go with their execrable status quo and this is the result. What a waste (in more ways than one). :)

Dojo is still teeming with UA sniffs (and other voodoo) in 2010. It’s a walking corpse. Use it and you will be downloading a whole new mess to deal with IE9 (assuming they don’t just give up in the interim). You can put that in the bank.

Comment by DavidMark — July 23, 2010

I’m still not sure David Mark is a real person. Grats Dojo team, that’s a lovely theme & would certainly appease my boss who once criticised one of my apps for not feeling ‘intuitive like Windows’. barf. I really must get into Dojo.

I wonders if these rumoured themeroller beef-ups will allow this kind of styling in jQuery UI…

Comment by friendlyjs — July 23, 2010

Congratulations to the Dojo developers!

@friendlyjs:
You shouldn’t care about David Mark. David Mark has tried to “change” the codebase of the Dojo Toolkit without success and is now angry about this fact. The problem was, that he started with coding “his” ideas about the “right JavaScript” without beeing able to discuss his changes with the rest of the developer community. Instead, he has ignored some important features in his “solutions” and started to “rant” about some facts, in his usual “childish irritating” discussion style. He was bigheaded and started to offend other devs. The problem with David Mark is, that he can’t stop his rants and rants and rants. David Mark was banned from the Dojo developer mailing list, after he started to insult more and more developers.

Comment by Sandr — July 23, 2010

ouch @ dojo.isArray, kinda clumsy to see such an oversight seeing as there are oogles of articles pointing out the problems with type checking on arrays. Minus one browny point ;)

*waits till someone starts a ‘premature optimisation debate’*

Comment by BenGerrissen — July 23, 2010

Haha, David Mark strikes again. They guy is a walking disaster area. Check out the main description of his JS lib “My Library”:

“If you’ve had the sneaking suspicion that most browser scripting projects are not ready for prime time, let us be the first to confirm your suspicions. Virtually all of them are sizzle without solid substance”

So, he starts off with criticizing all other JavaScript toolkits every created, including Dojo, YUI, JQuery, Prototype etc. rather than explaining what differentiates his library.

He has a whole section titled “Others Inherently Limited and Dated”.

Take a look at all other toolkit home pages – not one of them trashes the competition. Because they don’t have to rely on that. They have actual strengths and differentiators.

Mr. Mark, on the other hand seemingly feels that he has to resort to attacking the whole world (I’m not crazy, everyone else is….)

Stay classy David.

Comment by sos — July 23, 2010

@timdown

SteveFDotNet: What exactly is right with that tabbed pane?

There. Fixed that for you.

Comment by ThePeanut — July 23, 2010

I don’t think typeof == ‘array’ is future proof in any way, since no browser will be changing that anytime soon as that would break lots of existing code – we are stuck with that icky behavior. This is the future proof way thats in ECMA5 and available in some browsers now:

Array.isArray([1, 2])

Comment by ratbeard — July 23, 2010

I heard that FuseJS can run the Claro theme _shinier_ than Dojo can run the Claro theme…

Comment by SlexAxton — July 23, 2010

Unclear if work on new themes is a good sign. Perhaps it is a poisonous strategy, reflecting a design paradigm that is nearing obsolescence. I think it can be argued that dojo/ext and similar application libraries are destined for irrelevance (which is a general comment in no way a criticism of their great work). This sort of interface cannot be innovative, and now we’re seeing the last gasp of such interfaces — innovation through theming. Indeed, it could be argued that point-and-click interfaces are in the crosshairs, which suggests a fertile new time for UI design. Perhaps more innovation around expressive data models (such as powerful arrays…), around controlling and mixing semantic objects, around consistent data whose interfaces are natural. Away from the “arrogance” of such constrained thinking.

Comment by nataxia — July 23, 2010

@sos

“Check out the main description of his JS lib “My Library”:”

You missed the boat. As clearly stated the first few paragraphs on the home page refer to an upcoming site (and were only recently added). My Library has been out for years and for most of that time I have exhorted people not to use it as I don’t think GP libraries (no matter how modular and compatible) are appropriate for a single-threaded language that must be downloaded to browsers (some of which have very limited resources). It wasn’t written to “compete” with dubious libraries and frameworks, but to demonstrate how such things can be written in competent fashion (i.e. without sniffing browsers).

For those hypnotized by shiny widgets. Background graphics are readily available on the Web and have nothing to do with scripts. Choosing scripts based on the graphics included in their archives is like buying a car based on its installed radio.

And, oh BTW, Dojo’s widgets have never worked with Opera (any version), even with more browser sniffs per module than anything comparable.

Not only have I read the Dojo code, but I was tasked by its owners to rewrite large portions of it about a year back (which I did). It is a testament to the relative inexperience (and massive egos) of its developers that they failed to use any of it in a timely fashion (at which point I yanked the whole fork off their table). So I know what I am talking about with regard to the code. It’s horribly inept, inefficient, incompatible and pretty much irrelevant at this late date.

The isArray thing is just the tip of the iceberg. But don’t take my word for it. These scripts are completely transparent after all. There’s the aforementioned browser sniffing, synchronous XHR, an “attr” function that nobody associated with the project can explain and that all of these widgets depend upon. The “modularity” is all smoke due to incessant interdependency (e.g. XHR module requires the query module). And speaking of queries; last I checked, their rendition was thoroughly botched (partly due to the aforementioned “attr” function). In short, the core code makes jQuery look like a masterpiece.

Professional developers don’t abdicate responsibility to programmers who don’t understand their own code and refuse to take steps to gain such understanding.

Comment by DavidMark — July 23, 2010

Professional developers don’t rant and rant and rant…
Fact is, nobody is willing to work with you or hear your arguments, dear David. Because of your personality – unfortunately…
Grow up, David.

Comment by Sandr — July 23, 2010

It is important to keep to technical matters and not be dull. But the Ajaxian site reminds all that a civil level of discourse is crucial. We want clear channel communication.

Comment by jackignatius — July 23, 2010

Though dojo.isArray may work as is, by having code like that in its base Dojo is indirectly propogating bad practices. People do read through the source of the big js libraries to learn how to do stuff and pick up tricks.
.
The docs states that the function returns a Boolean; this is not true if the passed argument is falsy (0, “”, null etc) – the argument gets returned raw! No type coercion.
.

var myVar = 0;

if (dojo.isArray(myVar)!==false) {
alert('Dojo says myVar IS an Array!');
}

.
And then tere’s the typeof-bit which as mentioned in earlier comments may not be harmful – but certainly wrong.
.
dojo.isArray should be inlined with dojo.isFunction’s implementation. Done.

Comment by rasmusfl0e — July 23, 2010

@DavidMark: why are you such an arsehole?

Comment by Yansky — July 23, 2010

@Sandr

Professional developers don’t rant and rant and rant…

Who’s ranting? Every technical point I made can be demonstrably proven or refuted. But the only responses I see are insults (likely from Dojo shills).

Fact is, nobody is willing to work with you or hear your arguments, dear David.

Fact is, you don’t know me from Adam. And loads of people hear my arguments (obviously you included). Now whether they listen…

@Yansky

why are you such an arsehole?

Listen, gov; grown-ups discuss ideas. Little children (and incurable gossips) talk about people. What is it about Dojo’s massive failings that makes you so uncomfortable that you would insult the messenger in such an obscene fashion? Did you stake your career on it? If so, that’s a real pity; but don’t blame me for your poor choices.

Comment by DavidMark — July 24, 2010

Unfortunately there are tons of discussions like this with bad comments and hidden insults from _your_ side, David. If you would be able to discuss technical points without your “rants”, nobody would say a word. But look at your discussion style in reality, instead. One could say, the name “David Mark” stands for insults and rants. That disqualifies you.

Comment by Sandr — July 24, 2010

@nataxia: I’m assuming you’re referring to touch interfaces like the iOS ones? Those still use themes and styled controls. They still have buttons, radio buttons, check boxes, tab controls, styled lists, and so on. If there’s a “natural” interface that does away with controls outright, I’ve yet to see it (and I can’t even imagine one, except for a speech-driven interface).

Comment by Joeri — July 24, 2010

Let me put this the same way:It is important to keep to technical matters and not be dull. But the Ajaxian site reminds all that a civil level of discourse is crucial. We want clear channel communication.

Comment by jackignatius — July 24, 2010

I heard that one time, David Mark created a widget _so backwards compatible_ that you could use it before the internet existed. AND I heard he did it without any browser sniffs, or internet sniffs…

Comment by SlexAxton — July 24, 2010

@joeri … Let’s talk about the iPad. Continue with your line of thinking. Buttons, check boxes, tabs, … go through all the UI controls you might find in an interface guideline manual. Perhaps write this list down. Some will of course maintain (things need to be checked; buttons need to be pressed). However, note how the treeview has gone away. Note how little drag and drop is used. Think of how the context menu has changed. How many data grids have you noticed? Panes? Scrollbars? Conversely: multitouch — many new UI ideas, yeah? Consider the consistency of iPhone/Pad interface design (most of the usability talk is about the problems with apps using various looks and feels for controls, not how little theming is provided). ‘Natural’: anyone can immediately understand how to interact with the data (do not underestimate predictability as a major reason for apple’s UI successes). Speech is of course already an exciting part of the new interface toolkits, but that is not what I mean, as mentioned. Imagine one where your location on the planet automatically creates a view for you based on what you probably are interested in, perhaps based on what you’ve done before. Imagine an interface which absorbs audio through a microphone and offers you options on how to interpret that sound. How would you build that interface? Probably would have to model frequency, and provide controls for selecting from frequencies… does a dropdown sound like the best you could do? Imagine.

Comment by nataxia — July 24, 2010

Unfortunately there are tons of discussions like this with bad comments and hidden insults from _your_ side, David.

What are “hidden insults”? Are they better or worse than overt insults (like those favored here). And there are no “sides” either. Code logic is what it is. Refute my points or try to understand them, but don’t pigeonhole them as belonging to some mythical “side”.

If you would be able to discuss technical points without your “rants”, nobody would say a word. But look at your discussion style in reality, instead.

People are welcome to say what they like. Non-responsive “answers” and insults only serve to underscore my assertions. And I find it interesting that you put “rants” in ironic quotes. Subconscious slip-up?

One could say, the name “David Mark” stands for insults and rants. That disqualifies you.

You said that, but you are not an arbiter here.

@StexAxton

I heard that one time, David Mark created a widget _so backwards compatible_ that you could use it before the internet existed. AND I heard he did it without any browser sniffs, or internet sniffs…

You have missed the point. Testing code in environments other than the latest desktop browsers in their default configurations is a good way to determine the solidity of its feature detection/testing and therefore its ability to degrade gracefully in unknown environments. And the most important of unknown environments are the next versions of major browsers.

Why do you think I have had such well-documented success with forward compatibility over the years? On the other hand, why do you think that projects like jQuery and Dojo must be reworked every time a major browser (e.g. IE8, IE9) changes its stripes? Swapping out a large, complicated blob of JS requires a full regression test of the applications that rely on it. That’s not only time-consuming and expensive, but would be thoroughly unnecessary if these libraries lived up to their stated goals. Furthermore, the rearrangements invariably break the previous browser versions, thereby frustrating end-users who can’t/won’t upgrade their browsers in perfect sync with the “cares” of the Web developers.

Sorry if a duplicate (or near duplicate) of this follow-up shows up. FF3.6 froze on my first attempt to post. Also, this site is unusable for me in Opera 10.5, where it invariably locks up the entire browser. Which library was used for this thing? :)

Comment by DavidMark — July 24, 2010

@Sandr (who is very busy it seems)

@friendlyjs:
You shouldn’t care about David Mark.

Misdirection. Perhaps “friendlyjs” should care about things like performance, compatibility, etc. After all, those are the points I addressed.

David Mark has tried to “change” the codebase of the Dojo Toolkit without success and is now angry about this fact.

No, it was a huge success, which was then discarded due to well-documented ego issues of the Dojo developers. Your months-late revisionism in blog comments won’t change that.

The problem was, that he started with coding “his” ideas about the “right JavaScript” without beeing able to discuss his changes with the rest of the developer community.

That’s patently untrue. I was working with Peter Higgins and Dylan Schiemann from the start and they were quite excited would the results I produced.

Instead, he has ignored some important features in his “solutions” and started to “rant” about some facts, in his usual “childish irritating” discussion style.

That’s also untrue (if I’ve made sense of what you are trying to say anyway). The discussions are all a matter of public record (see the Dojo trac and developer list archives.

He was bigheaded and started to offend other devs.

When there are as many obvious problems as were (and still are) present in Dojo, it is inevitable that those responsible for those problems will take offense to being told they made mistakes. And yes, they compensated by hurling insults and making up stories about “important” features that were somehow lacking in my rendition. Again, check the record.

The problem with David Mark is, that he can’t stop his rants and rants and rants.

The problem with anonymous windbags who don’t know me from Adam is that they don’t know what they are talking about on any level.

David Mark was banned from the Dojo developer mailing list, after he started to insult more and more developers.

That’s also untrue. The owners of Dojo, who brought me in to clean up the mess in the first place, told me a couple of times that some of the dejected developers were calling for my “ban” from their mailing list. But I was never banned (for reasons that should be obvious) and can post there to this day if I choose. Like I told them, they should ban the crybabies who were impeding progress on the project due to ego issues.

Comment by DavidMark — July 24, 2010

@rasmusfl0e

dojo.isArray should be inlined with dojo.isFunction’s implementation. Done.

Not exactly. When designing low-level functions, the first question that should be asked is what problem will they solve? In other words, the higher-level designs will need to call on them for answers, so what are the questions? These questions must be spelled out explicitly, which was clearly not done by the Dojo developers in this case.

So what is isArray supposed to do? In general, it is to discriminate between Array objects and something else. The big question here is what is that something is allowed to be.

According to code comments and the subsequent usage of this function throughout Dojo, that something includes host objects. That was their first mistake as host objects are implementation dependent.

See: http://www.cinsoft.net/host.html.

So one of the first things I did was to search out every isArray call in every module and determine which were attempting to discriminate between built-in Array objects and host-provided array-like objects. These cases did not represent the majority and I dealt with them by re-factoring the higher-level code to eliminate the need to do the impossible. One problem solved.

Of the many remaining calls to isArray, a large portion were attempting to discriminate between arrays and strings, arrays and numbers, arrays and undefined, etc. Those were easy enough to inline. For example, consider a function that is “overloaded” to accept either an array or a string:-


// Accepts strings or arrays
function myFunction(x) {
if (isArray(x)) {
// Do something with array
} else {
// Do something with string
}
}

That’s clearly the wrong way around. It’s perfectly possible to detect strings without the ambiguities that make detecting arrays impossible to do reliably.


function myFunction(x) {
if (typeof x == 'string') {
// Do something with string
} else {
// Do something with array
}
}

I made similar adjustments in hundreds of places (much to the chagrin of each module owner, many of whom did not understand the problem or solution). Presto! No more isArray!

And why is such a function ill-advised? For one, inexperienced developers will use it without realizing the ramifications. A good example is that IE < 9 returns "[object]" when arrays created in other windows are passed through the dubious "Miller device" and instanceof doesn’t work across frames. Even worse, IE9 returns “[object]” for arrays created in an IFRAME, which means that all of those isArray calls will now have unexpected consequences in the next version of the most-used browser on the planet. It’s ironic that I tried to explain all of this to the Dojo developers a year back, but they were hampered by a “show me where it fails” mentality that dismissed any attempts to explain such abstract concepts. Now they (and their users) get to see just where it fails.

As for isFunction, there is never a real need for that one either. Despite the fact that many of the “majors” (e.g. Dojo, ExtJS) run functions through the same dubious “Miller device”, there is no need to do that as Function objects do not create ambiguous results when tested with the built-in typeof operator.


// NOTE: x may NOT be a RegExp or host object
function isFunction(x) {
return typeof x == 'function';
}

Of course, such a simple function is unneeded overhead, so I set about replacing it with inline code, checking each case to determine whether it really needed to discriminate between regular expressions or host objects (both of which could result in “false positives”). There were only a handful of such cases and I dealt with them just as I did for isArray. There’s one less unneeded type-checking function.

Now, if you are relatively inexperienced and used to relying on such crutches, you might well squawk about a design that does away with them entirely. This was also the case with the inconceivable amount of UA-based browser sniffing, all of which was replaced with feature detection, testing and in one or two places, superior object inferences (which I would have designed out of the system eventually as well).

For a “real world” example of this you need look no further than jQuery where UA-based sniffing was replaced with (often questionable) object inferences and it was proposed that the property that held the sniffing info be deprecated (and ultimately eliminated). Lots of relatively green plug-in developers were up in arms about the removal of their “needed” crutches. They didn’t attempt to understand the evolution as they were too busy “getting stuff done” with browser sniffing. Of course, anything “done” with sniffing is not really done at all. Invariably, somebody has to revisit that code in the future just to maintain perceived compatibility with a handful of “supported” browsers. As mentioned previously, such twiddling inevitably breaks previous browser versions, which are then lopped off the list of browsers that the developers “care” about. That’s not problem-solving; it’s disguised futility. ;)

Comment by DavidMark — July 24, 2010

I worked with Dojo since release 0.9 and I found the Dojo development team very easy to work with. To my knowledge there are no ego issues on that team – these people work together very well. As far DavidMark, he is recognized as an expert JavaScript developer with in-depth understanding of browser differences. It’s that his knowledge is burdened by his communication style. Consequently, he is now mostly ignored within this group.

Comment by Les — July 24, 2010

As a side note, the formatting of comments here is awful. What do you have to do to get space to show up between paragraphs? This is likely the result of some over-zealous CSS “reset”, which is also ill-advised, but that’s another story.

A preview feature would be nice as well.

Comment by DavidMark — July 24, 2010

@Les (last name?!)

I worked with Dojo since release 0.9 and I found the Dojo development team very easy to work with.

That’s pretty much irrelevant. See my last post (or next to last post rather).

To my knowledge there are no ego issues on that team – these people work together very well.

Did you point out a million mistakes? Furthermore rewriting them, much to the chagrin of possessive module owners?

As far DavidMark, he is recognized as an expert JavaScript developer with in-depth understanding of browser differences.

Thanks, but that’s not quite accurate. I don’t memorize browser differences as I have no need to do so. This stuff is about understanding abstractions, not observing browsers.

It’s that his knowledge is burdened by his communication style. Consequently, he is now mostly ignored within this group.

Are you having trouble understanding me? And people are doing quite a good job of “ignoring” me, aren’t they? Hell, the whole thread is about me at this point. :)

Comment by DavidMark — July 24, 2010

I had never even heard of David Mark before today.

I’m a long time jQuery user myself and accept that, like any other software, it has bugs – but I don’t troll the community like he does.

I was googling to look at JS GUI libraries and this article came up for Dojo, and after reading his bilge on here I will certainly NOT be using or even considering his library even if it is better or has less bugs, purely because of his attitude (and I’m @tanepiper on twitter David and I’ve said the same thing to you there).

Comment by digitalspaghetti — July 24, 2010

Hmm. My last two comments have suddenly vanished. Has some misguided moderator reared their ugly head?

I’ll assume, for the moment, that the site is broken (not a stretch by any means).

Comment by DavidMark — July 24, 2010

Let me another way put this: Important is it to keep to technical matters and not be dull. But the Ajaxian site reminds all that a civil level of discourse is crucial. We want clear channel communication.

Comment by jackignatius — July 24, 2010

@jackignatius

Let me another way put this: Important is it to keep to technical matters and not be dull. But the Ajaxian site reminds all that a civil level of discourse is crucial. We want clear channel communication.

Uh Jack, what happened to my last two or three comments. One of them described in detail flaws I noticed in the cited demo (e.g. the menu bar wrapping and partially obscured behind the tabs). I can’t imagine *that* was deleted by a moderator; unless there is some sort of conflict of interest and related damage control going on. (?)

Also, though I know they are aimed at others (I am keeping to technical matters and I’m sure as hell not dull), your repetitive, drumbeat missives are getting irritating. And in this last one you seem to be channeling Yoda. :)

Comment by DavidMark — July 24, 2010

@digitalspaghetti :)

I had never even heard of David Mark before today.

Odd.

I’m a long time jQuery user myself…

…and first time caller?

…and accept that, like any other software, it has bugs – but I don’t troll the community like he does.

Yes, jQuery has bugs galore. But what community am I supposed to be “trolling”? You sure won’t find me in any jQuery-related forums.

I was googling to look at JS GUI libraries and this article came up for Dojo, and after reading his bilge on here I will certainly NOT be using or even considering his library even if it is better or has less bugs, purely because of his attitude (and I’m @tanepiper on twitter David and I’ve said the same thing to you there).

Hey, nice attitude; but your personal sympathies or misreading should not affect your choice of scripts. Regardless, contrary to legend, I don’t care who uses My Library. It’s free after all.

Also, I appreciate the long-winded messages sent to my Twitter account. What were those about? Spite?

Comment by DavidMark — July 24, 2010

Take two on this one (first disappeared).
.
@Rey Bango

…theme is incredibly clean…

.

Not from where I’m sitting.

The menu bar wrapped and several of the menu items were mostly obscured by the tabs below. These schemes to cut out the browsers’ built-in (and free) layout abilities and replace them with single-threaded layout scripts have always been folly.

In the same way, the ill-advised “CSS reset” used on this site makes every paragraph flow together requiring adding extraneous periods to comments to put back what was there to start with. Browsers (and users) have default styles for a reason. ;)

.
Also, some of the faux buttons caused their containers to twitch (scroll a few pixels for no reason).
.

And as for the CSS3 “themes”, I’m not impressed (for reasons that should be obvious). If you download this behemoth because of animated background colors, you should not be in a decision-making position that involves choosing scripts.

.
This was in Safari 4, which I believe is on the list of “supported” browsers. Not a good first impression. Of course, knowing what lies beneath, I wouldn’t use or recommend it if it painted the Mona Lisa. :)

Comment by DavidMark — July 24, 2010

If I can be certain about anything, it’s that I’ll never use “My Library” or anything else that David Mark develops. Sorry dude, I don’t know you and I don’t care how good you are, in actuality or in your own mind. I won’t support someone with your attitude coming here just to take a crap on someone else’s work. If you don’t like it, ignore it. Very simple.

Comment by ajaxery — July 25, 2010

@ajaxery :)

If I can be certain about anything, it’s that I’ll never use “My Library” or anything else that David Mark develops.

For one, how would you know whether I developed it? In reality, you can’t really escape my code. And did you not read the bit where I encouraged people not to use My Library (for whatever reason). I don’t care; why so many people keep “threatening” not to use it is beyond me.

Sorry dude, I don’t know you and I don’t care how good you are, in actuality or in your own mind.

The feeling is mutual. :)

I won’t support someone with your attitude coming here just to take a crap on someone else’s work.

Um, seems most people posting here are trying to take a crap on me and ignoring the technical points entirely.

If you don’t like it, ignore it. Very simple.

What sort of society would that be? Public debate is a good thing. What I don’t understand is your angle. You do realize this is a discussion about Dojo, right?

Comment by DavidMark — July 25, 2010

@all: chill, it’s just javascript
.
@nataxia: First of all, the only “natural” interface is the nipple, everything else is learned behavior. I think natural is a misnomer, and what we’re really talking about are efficient and intuitive. Efficiency and WIMP go well together (iMovie on the iphone is a lot less efficient than on the mac). Intuitiveness, that’s in the eye of the beholder. To me WIMP is intuitive, but only because my mind has been perverted to appreciate it.
.
Secondly, while I agree that the iOS interfaces are interesting and easy to use, I disagree that it’s a new dawn for computing, because they simple don’t do everything computers do. These UI’s don’t have many tree controls because they don’t deal with data sets that have complex hierarchies. They don’t deal with drag-and-drop, because they have workflows that are linear in nature, and drag-and-drop fits better with pulling together disjointed data elements. As an example, take pages on the ipad. It’s simpler than pages on the mac, sure, but mostly because it does less. And even then, it makes heavy use of buttons, controls, lists, even tool bars! It’s intuitive because we know all that stuff from the desktop, but it’s still a WIMP design at heart, even if the mouse is replaced by your finger and it has no overlapping windows. Pages also doesn’t care what your location is, because that’s irrelevant to its purpose. Most apps are like pages, not like layar, and that’s not going to change.

Comment by Joeri — July 25, 2010

@Joeri

chill, it’s just javascript

Well, JS has the unique ability to make or break a Web presence, particularly these days with all of the new mobile users. And it’s not just for Websites these days either. You could argue it’s the most important programming language in use today. If only it wasn’t also the most misunderstood language as well.


Personally, I don’t get the knee-jerk outrage at any and all criticism of JS-based software (particularly open source efforts). I mean, did drivers of 70′s model Pintos rail against Mother Jones for warning about the potential of fiery explosions? Was Nader’s “Unsafe at any Speed” met with disapproval by anyone but automobile industry executives? It’s not that all of these juvenile responses were posted by would-be shills, but certainly those responsible are not thinking clearly.


And am I the only one who sees the irony in Dojo promoting a new “Promises-based” API? :)

Comment by DavidMark — July 25, 2010

@DavidMark

I’ll tell you what that quote says: “you are an imbecile”. You linked to a lone user submission instead of the Examples page

LOL, imbecile! Lets back track shall we. The link to the shoddy tabbed pane is actually on your examples page, on your site – where I took it from! That tells me your a cretin for not even knowing the content on your own site. But I forgive you your cretinous mistake, you must be in pain seeing the other js frameworks rolling out fully fledged ui libs when yours is floundering so bad.

Comment by SteveFDotNet — July 25, 2010

@SteveFDotNet

LOL, imbecile! Lets back track shall we.

Sigh, if we must. :)

The link to the shoddy tabbed pane is actually on your examples page, on your site – where I took it from!

First off, it’s not shoddy. I think the user did a good job on his example. Second, it is not on my Examples page, but linked from it. The Examples page has lots of examples of add-on widgets, including a tabstrip, but not that one as it is a user submission (which is clearly stated above the link to it).

That tells me your a cretin for not even knowing the content on your own site.

You have clearly misread something.

But I forgive you your cretinous mistake, you must be in pain seeing the other js frameworks rolling out fully fledged ui libs when yours is floundering so bad.

You are certainly full of misconceptions (among other things).

Comment by DavidMark — July 25, 2010

Sorry people I’ve got to agree with David Mark – this is not about who we like or don’t like, but about writing “Good Code” – solid, reliable code that doesn’t need constant maintenance when new browsers are released. If you read his comments (I mean really read them and study and understand the examples) – you’ll see he has multiple/valid points.

And I second his point on not using JS Toolkits/GUI libs – they’re a crutch – and eventually this crutch will break and you will fall. They lock you in to what they support and how they work.

We use JQuery on our website (against my recommendation) for fading three images in/out… so thats 80k of js lib + another network request… just for one effect, which could have been written in a few lines of code (and I did).

Comment by wukfit — July 26, 2010

Sorry people I’ve got to agree with David Mark – this is not about who we like or don’t like, but about writing “Good Code” – solid, reliable code that doesn’t need constant maintenance when new browsers are released. If you read his comments (I mean really read them and study and understand the examples) – you’ll see he has multiple/valid points.

And I second his point on not using JS Toolkits/GUI libs – they’re a crutch – and eventually this crutch will break and you will fall. They lock you in to what they support and how they work.

We use JQuery on our website (against my recommendation) for fading three images in/out… so thats 80k of js lib + another network request… just for one effect, which could have been written in a few lines of code (and I did).

Comment by wukfit — July 26, 2010

…and you might want to fix being able to click the submit button multiple times – hence I’ve managed to double post.

Comment by wukfit — July 26, 2010

Those of you dismissing David Mark out of distaste for his style are being foolish: read his technical points, do a little research to see if he’s correct. You don’t have to like him.

Is anyone going to tell me what exactly is wrong with the tabbed pane example linked to earlier in the thread?

Comment by timdown — July 26, 2010

Appallingly, this is from the Dojo trunk:-

dojo["eval"] = function(/*String*/ scriptFragment){
// summary:
// A legacy method created for use exclusively by internal Dojo methods. Do not use
// this method directly, the behavior of this eval will differ from the normal
// browser eval.
// description:
// Placed in a separate function to minimize size of trapped
// exceptions. Calling eval() directly from some other scope may
// complicate tracebacks on some platforms.
// returns:
// The result of the evaluation. Often `undefined`
return d.global.eval ? d.global.eval(scriptFragment) : eval(scriptFragment); // Object
}


First of all, that warning about being a “legacy method” and “exclusively for use by internal Dojo methods” is new and apparently the “solution” that was arrived at in light of my criticism (and subsequent rewrite) of this method last Fall. Of course, it’s no solution at all as the problem is with the logic (which no comment will fix) and the critical bits of the low-level Dojo code that call this method.

Furthermore, the comment that the behavior will differ from the normal “browser eval” is false (in more ways than one). What they meant to say was that the eval function that is built in to the language by specification and provided to all host environments (including browsers) may differ from that of this method. That distinction, in and of itself, is a serious problem for an ostensibly cross-browser script that also claims to work in environments other than browsers.

And, last but not least, they removed the description of what this function is expected to do (to avoid future embarrassment I suppose). Since the beginning, this method has been advertised to evaluate a script fragment in the global scope. But one look at that ternary operation should make it clear that it does nothing of the sort.

And, of course, like many other “major” libraries, Dojo conflates the term “scope” to refer to the – this – keyword, so it’s hard to say whether the original developers (and all who have come after) were trying to limit the scope chain, set the this keyword or both. In any event, the single line of code reveals that they failed to do that in any sort of consistent fashion.


The dojo.global property is typically set to reference a window object. In some environments, calling eval as a method of the window object will indeed evaluate the passed script in the global scope and set the this keyword to the Global Object. But clearly at some point in the development of Dojo, its authors observed a deviation from this non-standard behavior (which would certainly be something to expect from a method with no formal specification). The “solution” was to add a fallback to call the “browser eval” directly. The implications of such a hasty patch-by-observation should be clear: in some environments the method would work as “expected” and in others it would not as a direct call to eval uses the scope and this object associated with the current execution context. In this case, the scope chain would include all of the Dojo bootstrap, which includes hundreds of identifiers and the this object would reference the dojo object.

So, as context is always the key to these problems, and as with the type-checking methods, I looked at what the higher-level code was trying to do with this method. It turned out that 99% of the time the caller discarded the result of the evaluation, which allowed for the use of the Function constructor. Combined with moving the declaration of the method to the global scope (outside of the anonymous one-off function found in the bootstrap module) and eliminating named arguments solved the problem:-



dojo['eval'] = function() {
return (new Function(arguments[0]))();
};

It’s mot quite global scope as there is still a local activation object with an – arguments – identifier, but it was close enough for the context in which it was used.

To cover the remaining 1% of cases where the method needed to return the result of the evaluation, I recommended adding a second function. However, to preserve backward compatibility, I simply specified an optional second argument:-



dojo['eval'] = function() {
if (arguments[1]) {
return eval(arguments[0]);
}
return (new Function(arguments[0]))();
};

And in these handful of other cases, I changed the calls to look like this:-



var dojoEval = dojo['eval'];

dojoEval(scriptFragment, true);


…hence setting the this object to reference the Global Object.

That was that (or so I thought). As this one-liner is one of the first methods created by Dojo, I decided to open my discussions with the secondary contributors (I already had the blessings of the primaries) with this method. What could be simpler? As an omen of things to come, and as preserved in the Dojo developer mailing list archive, my assertion that the original dojo.eval was faulty was met with howls of derision and calls of “show me where it fails” (as if logic must demonstrably fail to be incorrect). Furthermore, one major contributor opined that he couldn’t imagine that Dojo used eval for anything “important”.

Long story short (too late), I pointed out that the much-ballyhooed loader used this method to evaluate Dojo modules (as well as the very obviously fractured logic). Nearly a year later, you can see the result (a few modifications to the comments, which still don’t make any real sense). Why wouldn’t they have changed this criticial one-liner? Apathy? Spite? Who knows, but their inaction speaks volumes.

So it doesn’t really matter how many widgets or themes they cram into the archive. The bottom line for those choosing a framework to alleviate the rigors of cross-browser scripting is that the authors of this thing do not understand the language they are using and apparently have a hard time grasping very basic logic. The idea that such authors would be capable of writing a “full-fledged” application framework in anything but an incompetent manner is beyond ludicrous and abdicating responsibility to such authors can only be considered career suicide.


Furthermore, despite various odd remarks here to the contrary, I don’t issue such warnings out of “jealousy” (there’s nothing to be jealous of). On the contrary, the more people who use such scripts the better for me. After all, I’m in the business of bailing people out of jams that often result in the use of such dubious front-end software. Dojo has been a specialty ever since I rewrote the silly thing (I still have the branch and refer to it almost daily). If you have inherited a Dojo project or are otherwise stuck with it, drop me a line. If not, I truly hope you have paid attention here and I won’t be seeing you as a client in the future (at least not related to Dojo). :)

Comment by DavidMark — July 26, 2010

@timdown

Those of you dismissing David Mark out of distaste for his style are being foolish: read his technical points, do a little research to see if he’s correct. You don’t have to like him.


Thanks Tim. Though it would be nice to be liked. :) Of course, if you ask anyone who has actually worked with (or for) me, clients, etc. you will find I am almost universally well-liked. The typical exceptions are groups of open source developers with ego and/or confidence issues. They don’t seem to respond to my brand of motivation (much to their detriment as evidenced here).

Is anyone going to tell me what exactly is wrong with the tabbed pane example linked to earlier in the thread?


Not a damned thing. Ethan did a great job, writing the entire widget from “scratch” (using the My Library API of course). It looks nice and works well (or degrades gracefully) in virtually every environment (and I helped him test a lot of them).


Like the article it was based on, it is an outstanding example of cross-browser progressive enhancement, which is completely impossible to do with multi-browser sniffing frameworks like Dojo (because there is no way to know in advance which methods will work in the current environment).


I think he made one very minor adjustment to the CSS after I copied it to my server though (single-pixel Opera issue IIRC). I’ll see about grabbing his latest version later today…

Comment by DavidMark — July 26, 2010

This particular discussion is closed.

Comment by jvaughan — July 26, 2010

Sorry, the comment form is closed at this time.