Garrett said:
David said:
Garrett said:
David Mark wrote:
Garrett Smith wrote:
David Mark wrote:
lorlarz wrote:
On 02/03/10 01:32, lorlarz wrote:
[...]
What do you think I meant?
I thought you meant variable name.
It's still a stupid name.
The comment in the code made sense to me. I understand why they do that.
They want undefined to be munged and faster lookup. The outcome should
be slightly smaller and slightly faster, and the code still looks
"normal" in the sense of comparing things to `undefined` in un-minified
code.
How is it a good idea to make code look like something it is not?
The only downside would be to rely on using `undefined` instead of
typeof, where the typeof helps swallow an error.
And readers thinking - undefined - is something that it isn't.
[...]
// Use grouping operator to avoid ASI-related error.
Huh?
ASI = Automatic Semicolon Insertion. If the JSON response begins with a
line terminator.
Yes.
[example]
So it's safer to to use grouping operator there.
Okay, but it that is not how your example reads.
var f = new Function("return("+responseText");");
Typo, BTW.
Yes, but if responseText has the json after a line terminator, the
function will end up returning undefined.
Yes, unless you stripped the leading line terminator. But what does any
of this have to do with the above example (which has a typo?)
Some APIs encourage the use of JSONP via dynamic script loading.
Yes.
http://suggestqueries.google.com/complete/search?qu=****&jsonp=while
while(["****",[]])
Profanity results in a cleaner example here, the "while" method is a
joke. No innuendos there.
I don't follow that at all. How is using a profanity "cleaner" and what
is the joke?
For XHR, a proxy would need to be used. If the proxy introduces a line
terminator -- and it is very easy to do this inadvertently -- then the
fist statement in the function would be "return", and the result of that
function would be to return undefined.
Yes.
If it sounds like I tripped over this before -- I did.
That's how you learn about things. I've heard of these issues, but I
can't make heads of tails of any of your examples.
I don't really agree. I think modifying Object.prototype is wrong. If
you, the developer, add a script that modifies Object.prototype, my API
will not work properly. That is my contract to you.
It's not about right and wrong. It's about the reality of deploying a
script on the Web (at least for scripts that must run on any random page).
[...]
Why would anyone in their right mind use Dojo? Mass hysteria?
"We don't have time to write everything from scratch".
Well, get some programmers who aren't fresh off the banana boat and you
very likely won't be writing much of anything from scratch (and you sure
as hell won't be using Dojo!)
"There's no sense in reinventing the wheel".
See previous answer and realize that Dojo is not a wheel. It's a whole
bunch of mostly unrelated scripts, most (especially at its core) are
inarguably rotten and clearly written by people who are both unfamiliar
with Javascript and certainly new to the world of cross-browser
scripting. They certainly haven't invented any wheels, they don't have
any wheel blueprints and as somebody who has been through _all_ of their
code, it is my studied opinion that they wouldn't recognize a wheel as
such if they saw one. Furthermore, based on interactions with their
developers, I don't see this changing ever. They say they are working
on some wildly new version for release in 2011 or something, but why
would anyone wait around for that bunch to put out another load of drivel?
"There is a lot of functionality that we can leverage".
You'll leverage yourself right into bankruptcy. The stuff is all based
on browser sniffing, so you will be in maintenance hell forever. Do you
really want to be asking them why your app has broken (again) and be
told that it is because version xyz never claimed to support IE9 (or
IE10 or Safari 5 or whatever). Furthermore, do you want to have to
explain to your visitors after the requisite "upgrade" fails to support
IE8 (or Safari 4 or whatever) that they are out of luck if they can't
immediately upgrade their browsers? And what about browsers that the
Dojo developers have never heard of or "don't care" about? You'll find
that visitors using those browsers will dutifully stop caring about your
sites. Of course it is a moot point as the whole bloated mess is
perfectly unsuitable for use on the Web anyway, which is why you never
see it out there. No amount of disingenuous "wowie" marketing (as
recently proposed in their forum) is going to make people mistake it for
something usable.
Well that's the reasons I've been given. Writing a javascript library is
time consuming and the manager faced with a project wants to use
*something* and if Dojo is something of an industry standard, then that
becomes an option.
And what defines an "industry standard?" Wide-spread use. Scratch
that. Perhaps some small portion of it is best in class? Not even
close. Take two examples, queries and Flash. Dojo's is renditions are
awful and unusable respectively. Of course, you can build your own
library with far better modules at:-
http://www.cinsoft.net/mylib.html
....and get support from me, rather than the people who wrote Dojo. It's
a no-brainer. Dojo has more modules, but quantity doesn't count for
much in this business, particularly when people aren't going to need
anywhere near all of them. Their modularity is a joke (everything
requires virtually everything else) and their widgets are so obviously
incompetent as to insult your intelligence (e.g. slow as molasses,
crawling with browser sniffs, accessibility nightmares, primary "owner"
of them is demonstrably out of his mind, etc.)
I could go on and on about Dojo and "Dijit" and the rest of their
bullshit and I very likely will. Libraries and the loose nuts behind
them are themes of the new site I've been working on. The two test
pages and counterpoint example library are just for starters. A review
of Dojo 1.4 will be one of the first features and will also be the first
one I've done on the Web (with lots of pretty code examples) rather than
on Usenet. Anyone who can get all the way through it and still thinks
Dojo is a good idea would have to be... well, one of the Dojo authors.