Tuesday, July 21st, 2009

Wouldn’t it be Swell to be able to drag and drop between Web and desktop

Category: Framework, HTML, JavaScript

<p>

Christophe Eblé has kindly written a guest post on Swell JS and his drag and drop manager that works with your desktop. Here he tells us more:

At Swell we were about to create a Drag & Drop Manager just like in other Javascript libraries such as Jquery, YUI, Mootools, Scriptaculous, but we were not really satisfied with this decision.

What motivated us to adopt another strategy is that we didn’t want to provide yet another simulated solution but instead a drag & drop library that would use the real power of the web browser.

We’ve been faced to a lot of problems and we are still struggling with API differences. The Pros and cons of using system drag&drop over simulated solutions:

Pros

  • Accuracy and performance, mouse move tricks to position an element under the pointer and detect target collision are things of the past, system DD is wicked fast!
  • system DD can be anything you like (simple images or complex dom nodes) and can interact within your browser window, the chrome (search field, address bar…) or tabs (if the browser allows it, FF 3.5 does it right) and even your OS.
  • system DD through the dataTransfer object can carry powerful meta information that are not necessary the dragged object itself, this can be arbitrary text (JSON data for ex.), urls and for the latest browsers complex data types see this
  • system DD has true DOM Events

Cons

  • Browser differences in this subject are a real pain, I couldn’t list all the oddities here :)

The drag & drop implementation in Swell is still at an early stage, and not officially released but here’s some details on what we’re working on.

  • Provide a single way to create native drag & drop objects in every possible browser
  • Provide setDragImage method on browsers that don’t support it yet
  • Provide a DD Manager that acts as a container for all drag and drop events on which you can place your handlers, cancel events, or quickly batch all the DD objects on the page. (useful when you deal with dozens of DD Objects)
  • Provide a way to associate complex metadata with each DD objects
  • Provide a way to easily create visual feedback for your DD Objects
  • Tight integration with our event library
  • and much more…

There’s a TRAC available on the project with a roadmap and release dates, a blog, and even a SVN repo that you can check out. Be careful, as I said above the library is still in heavy development and is missing docs! We are looking for any kind of help and just hope to receive massive feedback ;).

See some examples in action:

In the video, we are providing a simple yet powerful application to import a RSS feed in your webpage. The classical way is to type in the feed URL and then getting redirected to it, which commonly takes 3 to 5 steps. With this implementation you just have to drop the RSS icon onto an appropriate target and that’s all folks!

We use YQL and JSONP to transform RSS into JSON and of course a Swell Element to dynamically attach the behavior to the webpage:

javascript
< view plain text >
  1. var dd2 = new Swell.Lib.DD.Droppable('moo');
  2.  
  3. dd2.ondrop = function(e) {
  4.     var file = this.getData(e, 'DD_URL').split("\n")[0];
  5.     if (/^http\:\/\//i.test(file) !== true) {
  6.         return false;
  7.     }
  8.     $('debug').setHTML('loading…');
  9.     e.target.className = '';
  10.  
  11.     var yqlRequest = 'http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20rss%20where%20url=%22'+file+'%22&amp;format=json&amp;callback=moo';
  12.     html.script({
  13.         'type' : 'text/javascript',
  14.         'src'  : yqlRequest
  15.     }).appendTo(document.getElementsByTagName('head')[0]);
  16. }

Related Content:

Posted by Dion Almaer at 6:06 am
56 Comments

++++-
4.4 rating from 57 votes

56 Comments »

Comments feed TrackBack URI

Anybody know if Safari supports drag/drop of Files?

Comment by maccman — July 21, 2009

Webkit has experimental implementation of the file dataTransfer.
https://bugs.webkit.org/show_bug.cgi?id=25916

Comment by SleepyCod — July 21, 2009

SleepyCod:
Although that exposes ‘.files’ – they’re not very useful – I can’t see a way to access the data – and you can’t tack them onto a file input.

Comment by maccman — July 21, 2009

@maccman:

Get the latest Google Chrome build through the developer channel, put a file input into your page and drag & drop a file from your desktop to your input, this will select the file just like you’d do in the dialog.

If you want to access this file you can listen for the “onchange” event of the file input and post the binary contents over an iframe… that’s gmail approach and it works quite well ;)

Comment by SleepyCod — July 21, 2009

WebKit doesn’t allow manipulation of dragged content from the SAME SITE until they fix bug 23695 ( https://bugs.webkit.org/show_bug.cgi?id=23695 )

Comment by EliGrey — July 21, 2009

So, does this allow you to drag and drop files from the desktop to the browser using just javascript?

Comment by driverdave — July 21, 2009

Why is it that novices are so insistent on saving the rest of us from “reinventing the wheel” and why is their strategy always to reinvent the same old wheels?

The quickest way to dismiss a GP JS library is to look at how it handles element attributes. For instance, in three years, jQuery hasn’t moved an inch towards getting them right. The authors just don’t understand the methods, the IE issues, how properties are related, etc. They’ve been told a hundred times, yet they still get inconsistent results across IE versions, resulting in support queries that invariably go unanswered. It might seem odd that their “test suite” doesn’t catch the mistakes, but then it was written by the same amateurs.

This “swell” JS is starting over at the beginning with attributes (ten years after IE6 came out), so don’t even bother with it. Attributes are crucial to most Web applications. If consistent results are not produced across different versions of IE (let alone other browsers), it indicates the author(s) are just getting started with browser scripting (or it is three years later and they are too lazy or embarrassed to fix anything.)

If there is any lesson in the last three years or so, it is to avoid stacks of complicated scripts, especially those written by novices (should be a no-brainer.) Most sites don’t have any need for such scripts and the Web is such a complicated environment that even the simplest of scripts can encounter problems in the wild. Novices who haven’t even learned the basic rules are sure to fail and flail for years before attaining even basic competence. Remember that the next time some overconfident neophyte (or followers of such) offers to save you time to focus on the “task of the day.” What they really want is for you to waste years downloading “nightlies”, testing, filing tickets and perhaps buying books down the road.

Comment by DavidMark — July 21, 2009

@DavidMark:

You should get a life before teaching it to others.

Comment by SleepyCod — July 22, 2009

@DavidMark – Indulge us as to the method of ‘handling attributes properly’, that you feel jQuery has got so wrong…

Comment by sixtyseconds — July 22, 2009

Not to defend DavidMark, who sounds like a self-important douche, but today I did see something that jQuery gets wrong with attributes: http://stackoverflow.com/questions/1162270/cloning-background-image-with-parenthesis-in-file-name

I also saw something it gets wrong with selectors: http://stackoverflow.com/questions/1155213/how-do-you-escape-parentheses-in-jquery-selector

The latter is absolutely a bug, and the former most likely is too, as parentheses are valid in that part of a URI and should therefore be valid in a style attribute in that context.

On the subject of drag-drop with Swell, I’m much more interested to see file drop support. Safari supports it (if you drop into a file input, which is easily scripted with), I think the latest Firefox supports it. Does IE support it? It should be pretty easy to hack together support for at least the latest browsers that way.

Comment by eyelidlessness — July 22, 2009

@eyelidlessness :

File drag & drop is a hot topic but unfortunately the security model applied to D&D doesn’t yet allow for such kind of interaction, there are interesting talks about it on WHATWG ML.

Dragging a file over an input in webkit does work but you can’t listen on the “ondrop” event -> preventing default behavior of the event in dragover and dragenter makes the drop target unable to receive the file.
Here are the discussions about it:

http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-June/020302.html

And this one (Eligrey posted it above)

https://bugs.webkit.org/show_bug.cgi?id=23695

Comment by SleepyCod — July 22, 2009

@eyelidlessness – Fair enough, but jQuery has a bug tracker full of issues. So does MooTools. So does YUI.

It isn’t a problem that there are outstanding issues to these libraries/frameworks. If anything it’s a positive, since the libraries are improving all the time. Incidentally, I’ve battled with hyphen’s in MooTools’ old selector engine, but does that mean I am to dismiss it? Hardly.

“why is their strategy always to reinvent the same old wheels?” really is a stupid question. If they were all doing the same things in the same way then it would be needless, but competition can only grow the industry. And lets not forget the fellows who reinvented the cart wheels with them fancy shmancy rubber doohickies… -.-

Comment by sixtyseconds — July 22, 2009

Oh and from the Mozilla website:

A local file is dragged using the application/x-moz-file type with a data value that is an nsIFile object. Non-privileged web pages are not able to retrieve or modify data of this type.

Comment by SleepyCod — July 22, 2009

…incidentally, my argument is directed at DavidMark, not you eyelidlessness :)

Comment by sixtyseconds — July 22, 2009

@sixtyseconds – DavidMark has written extensively and persuasively on the subject of jQuery’s attr() method on the comp.lang.javascript newsgroup. I suggest having a search there: http://groups.google.com/group/comp.lang.javascript/topics

Comment by timdown — July 22, 2009

@timdown :

I don’t see how it is related to DD and Swell though.

Comment by SleepyCod — July 22, 2009

@SleepyCod – I was responding to SixtySeconds’s post:

“@DavidMark – Indulge us as to the method of ‘handling attributes properly’, that you feel jQuery has got so wrong…”

Comment by timdown — July 22, 2009

SleepyCod,

Dragging a file over an input in webkit does work but you can’t listen on the “ondrop” event

But form fields have a more generic event that’s better suited to the task: onchange. You of course then don’t need the dataTransfer, only the input’s value.

- – -

sixtyseconds,

this was the first thread I looked at, and even there I got the impression that Mr Mark is an exceptionally unpleasant fellow. Persuasive or not, I would be inclined to disagree simply to see just how unpleasant he could get – a morbid experiment or sorts. How can anyone afford to be so affrontive and still expect to be listened to?

On the other hand, having read that link I’m inclined to say that he has a good point and poor delivery, but I’m absolutely on his side with the point.

Look. This is the Internet. People are going to be acerbic. Get over it and pick out what they mean to say. In other words, be the bigger person. You’ll relieve needless stress, you’ll learn more, and you’ll eventually crowd them out by being able to relay what they’re saying without the bile.

Comment by eyelidlessness — July 22, 2009

@DavidMark Amen. I can understand that your words come across as harsh to some, but truth can hurt and is generally ill-received.

When I looked at the ‘swell’ events lib, its namespaces implementation and incredible amount of cruft made me cringe. I’ll leave no further comment, or else someone might stab me for having an opinion.

It’s time now that we take a step back and see clearly what we’re doing; we’re creating an insane amount of abstraction on top that was is in essence an abstraction already: Javascript. We forgot to understand the very basics of performance and optimal paths. Evertything we write boils down to assembly, opcode, transistors (I’m intentionally skipping a few steps ;) ). Especially with the new JIT compilers, it’s essential to go back to basics again to make Javascript live up to its potential, which I believe simply is world domination.
I’d hate to see that the worlds most beautiful webapps can only be viewed in the worlds newest, fastest browser on the worlds fastest – twenty-core? – desktop pc and a 30inch LCD screen. I believe world domination begins with the populi.

M.

Comment by mikedeboer — July 22, 2009

@eyelidlessness – Your point is well taken. Thanks :)

Comment by sixtyseconds — July 23, 2009

@mikedeboer :

As long as some browser vendors will not implement standards the way it should be, you’ll have to create abstraction layers to get productive and have a clean and reusable code.

I’d like to say this is for tomorrow, but it ain’t gonna be true…

Comment by SleepyCod — July 23, 2009

@mikedeboer – Finally, a response from a person with a real name. I’ll add that not only is this brand new script full of browser sniffing, but they stole my event detection function and didn’t credit me (or even a second-hand source.)

The attribute stuff is ridiculous. The “arguments” I hear daily are all the same: browsers are magic, browsers are different, jQuery is cool and “just works”, etc. With regard to the DOM, IE barely changed at all from 1999-2008. Certainly get/setAttribute never changed (much to the chagrin of anyone paying attention.) There’s rarely a need to use these methods as most attributes are reflected by DOM properties. Such concepts are clearly beyond the grasp of jQuery’s authors who have been using the same broken code for three years (and in turn leading others to build on top of it.) That’s futility, not progress.

And how surreal is it to defend YUI, jQuery, etc. by pointing out that they all have thousands of outstanding bugs? That’s the sort of perverse reverse logic that is typically tossed around in these forums, blogs, etc. It’s called programming by collaborative misunderstanding (using the term programming very loosely of course.)

Then there are all of the silly CSS selector issues that should never have infected the basic Websites that most jQuery developers create (God knows you can’t create Web applications with that crap.) How many Websites need more than gEBI and/or gEBTN? The primary motivation seems to save keystrokes. Yeah, I know. Trade keystrokes now for endless (and lucrative!) rewrites and re-testing. And how many jQuery jockeys can debug anything, let alone some obscure issue in the guts of a CSS selector engine. How many get anything but clueless “try this” type responses in the support forums? Drop in there any day of the week to see for yourself. It never changes.

What’s the typical response? They refuse to listen unless the message sounds like a TV commercial. I bet they don’t like movie reviews either (especially those attacking their favorite cartoons.)

Comment by DavidMark — July 23, 2009

@timdown – I missed your response the first time. Credit is certainly due. Not just for the use of a real name, but for pointing out where the attr bodies are buried. I’m amazed at how wide-eyed the average jQuery fan gets when I mention that the method is (and always has been) broken. I’ve mentioned it every other week in CLJ for almost two years (people keep asking whether the script is worthwhile.) It’s used in virtually every jQuery example ever published. These are the same examples copied and pasted all over the Web by designers who think they’ve learned programming.

Fair enough question about handling attributes. First, cross get/setAttribute off your list. That’s about it. Use properties.

Comment by DavidMark — July 23, 2009

@DavidMark – My comments were perhaps quite unspecific. I’m not saying that a bug tracker full of bugs is a great reason to use a library, and libraries really shouldn’t persist in flawed logic when someone (such as yourself) has pointed the flaw out to the authors.

My name’s Chris by the way! :P

My point is that when faced with the choice of coding a large web application (not the usual mickey mouse websites that jQuery gets forced on); my options are (1) code all the client-side stuff from scratch, and by hand, until i have a huge mess of non-reusable code; or (2) use MooTools/YUI/jQuery/ExtJS etc. And I’d prefer to know that the issues with these frameworks are constantly being improved.

I guess my opinion wouldn’t be shared my someone who (for example) doesn’t care about the inner workings or a library as much as they just want it to do all their work for them. Your point on set/getAttribute methods makes sense, and I would advise the various libraries to take note, but until they do; I’m not about to dump all of them – my productivity would simply fall through the floor.

I do think I share your dislike for fanboys though :D

Comment by sixtyseconds — July 24, 2009

@Chris (AKA sixtyseconds):

“My comments were perhaps quite unspecific. I’m not saying that a bug tracker full of bugs is a great reason to use a library, and libraries really shouldn’t persist in flawed logic when someone (such as yourself) has pointed the flaw out to the authors.”

Yes, thank you.

“My point is that when faced with the choice of coding a large web application (not the usual mickey mouse websites that jQuery gets forced on); my options are (1) code all the client-side stuff from scratch, and by hand, until i have a huge mess of non-reusable code; or (2) use MooTools/YUI/jQuery/ExtJS etc. And I’d prefer to know that the issues with these frameworks are constantly being improved.”

Here’s the problems with your theory:

1. There are (far) more than two choices.
2. All of the mentioned monoliths are incompetently designed and implemented.

Think about #1. Or search CLJ as the “write everything yourself” argument has been done to death.

In a nutshell, the complex, interdependent and monolithic solution (yours or appropriated from others) is always the worst fit for browser scripting. There really are people who know better about this stuff; you just don’t see them around *here* too often. ;) What a dump.

Comment by DavidMark — July 24, 2009

@DavidMark :
but they stole my event detection function and didn’t credit me

For information here at Swell, when we are using a common design/pattern that someone created, we’re always linking to the source, in our case we are using the “isSupported” detection snippet of Kangax.

And the comments in our sourcecode :


/**
* Detects if a given event name is supported
* @function isSupported
*
* @param {String} eventName the Event name click, load, etc, never prepend "on" keyword as Swell does this job for you
* @see http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
* @return {Boolean}
*/

And to finish, please use the JQuery posts to talk about JQuery, and finally try to respect their work (but maybe I’m asking too much).

Comment by SleepyCod — July 24, 2009

“For information here at Swell, when we are using a common design/pattern that someone created, we’re always linking to the source, in our case we are using the “isSupported” detection snippet of Kangax.”

Who got it from me. I don’t recall seeing any credit for Kangax, either; but I’ll take your word for it.

“And to finish, please use the JQuery posts to talk about JQuery, and finally try to respect their work (but maybe I’m asking too much).”

I’m talking about libraries, of which there are far too many. You should have waited a few years before tackling this stuff (but maybe I’m asking too much). And considering *your* attribute code (among other things), you should be glad I happened to stop by here when I did.

Comment by DavidMark — July 24, 2009

@DavidMark

Sorry but STFU…

Comment by SleepyCod — July 24, 2009

Real name? LOL. People have the weirdest hangups.

Comment by eyelidlessness — July 24, 2009

@SleepyCod:
“You should get a life before teaching it to others.You should get a life before teaching it to others.”
“Sorry but STFU…”

Don’t apologize. Your attitudinal shortcomings are your own. You know what they say about ignoring history. See Resig’s responses to similar criticism from two years back:

http://groups.google.com/group/comp.lang.javascript/browse_thread/thread/415949d1bcce6e6a/03c4d326340e7f7d

First stage is to question where my “cool library” is. Second is to petulantly ignore all further criticism. The jQuery developers realized they had thrown the game away years later and that led to a mad dash to correct years of accumulated mistakes before IE8 arrived (and they missed by a mile.) The last thing the Web needs at this point is more of the same.

Comment by DavidMark — July 25, 2009

@Eyelidlessness:
“Real name? LOL. People have the weirdest hangups.”

It’s not a hangup. Real names have reputations that precede them. It saves time knowing who you are talking to and having some idea as to where they are on the learning curve. I simply refuse to get into in-depth discussions with people calling themselves “Joe” or “ClumsyCarp” or whatever.

Comment by DavidMark — July 25, 2009

Very impressive Framework.
Realy a good start for a new JS library, and the DD manager is awesome.

@DavidMark
Can you stop talk about other libraries and just stop to throll on everything and everyone ?

Comment by Grepsd — July 25, 2009

@Grepsd:
“Can you stop talk about other libraries…”

It is foolish to ignore history (see previous reply).

“…and just stop to throll on everything and everyone”

Even if you meant “troll”, that still makes no sense. And calling someone a “troll” is a typical last resort for those who want to argue but can’t think of a relevant response. Maybe jQuery isn’t useless gibberish; he’s just trolling on everything and everyone. Yeah, that might fly here. I’ve seen similar chants practiced in the support forums.

Comment by DavidMark — July 25, 2009

@sixtyseconds:
“I’m not about to dump all of them – my productivity would simply fall through the floor.”

That should tell you something about your previous strategy. If you had not spent the last few years relying on the work of other beginners, you would have some of your own code to fall back on. Now you seem to feel you are stuck (which, depending on your point on the learning curve, you may well be). Odd as it may seem, the first step to recovery is not to blame the person making the diagnosis.

It boils down to this. What you can write in 20 minutes with jQuery or whatever silly library can be written in the same amount of time or less by those who know what they are doing. The difference is that solutions relying on scripts that are in a perpetual state of flux require near constant maintenance. That’s not good software any way you slice it. It’s the nadir of cross-browser scripting, which is judged by how often it must be maintained to deal with new environments. In other words, you aren’t saving time but passing on the losses to your clients and their users.

Can all of those happy-go-lucky Web designers be wrong? Of course they can. How many of them can even choose the correct markup language for a hypertext document? How many write competent CSS? And how many do you think can learn programming from a book by John Resig?

http://groups.google.com/group/comp.lang.javascript/msg/bcfdb3ad609a15fa

Welcome to the real world. It’s just as ugly as its current reflection on the Web. Anyone who tells you differently is deluded or selling something.

Comment by DavidMark — July 25, 2009

@DavidMark – Clearly you’ve been in this longer than I have (I’m actually enjoying the c.l.j thread you posted above); so I’m not about to continue an argument you’re more practiced in. With regards to having my own fall-back code – I do have. And when I see a gap in a (arch nemesis) library like MooTools or jQuery, then I try to implement a fix closer to that altruistic Javascript world you rule with an iron fist.

I think I’ll get back to my job, while you continue to insult the experience and judgement of other developers. Good day, sir.

Comment by sixtyseconds — July 26, 2009

I’m late to the party, but I do have one question for you David. Are you opposed to libraries in general, or just those you feel are written poorly? While I write a lot of javascript/css/html mostly within my own framework, I do utilize some things from YUI for events, for example. Seems silly to rewrite that stuff when others have put a lot of time making sure that the hairiest cross-browser problem areas covered.

Maintaining cross-browser compatibility for common base functionality in a shared library by several experts seems like a good idea to me. The bulk of your argument seems to be on whether or not these people are experts, but I’m curious if you oppose the idea in general.

Comment by genericallyloud — July 26, 2009

DavidMark,

“It’s not a hangup. [goes on to explain the hangup]”

Alright, sure, whatever.

“Real names have reputations that precede them.”

So do handles. Many of us don’t intend to become “famous” programmers and don’t act as the mouthpiece for some project or another, and so choose to remain anonymous on the Internet. That said, nothing is preventing you from researching the handles of people you interact with the same way you research the “real” names they claim to have. If you really feel you need to know more about me before you consider my opinions, lmgtfy.

That said, you’re basically saying that your ability to discuss depends upon your ability to engage in a variety of logical fallacies relating to the person you’re discussing with—rather than the merits of their arguments. If for whatever reason “where they are on the learning curve” (9_9) is relevant, you can determine that from context. But the likelihood is that it’s not relevant.

Seriously, you come across as a self-important asshole. Talking down to people, as you’ve done here and in linked areas of the Internet, is off-putting and detracts from whatever point you’re trying to make. Did your parents never teach you that you’ll get more flies with honey?

I say this because I think you *do* have a point to make—one that could not only improve the work life of those who rely on the libraries in question, but also could improve those libraries and thereby have an even greater impact on those who rely on them. But your delivery is almost guaranteed to get your point exactly nowhere.

When you come stumbling in and start calling people amateurs and not explaining why you have a problem with what they’re doing, the likelihood is that most of them aren’t going to inquire further.

Just something to think about.

Comment by eyelidlessness — July 26, 2009

@genericallyloud:

“I’m late to the party, but I do have one question for you David. Are you opposed to libraries in general, or just those you feel are written poorly?”

I am opposed to *general purpose* JS libraries, particularly those written poorly (which describes virtually all of them.)

“While I write a lot of javascript/css/html mostly within my own framework, I do utilize some things from YUI for events, for example. Seems silly to rewrite that stuff when others have put a lot of time making sure that the hairiest cross-browser problem areas covered.”

YUI’s event module is a joke (uses browser sniffing in 2009 for one.) Do not use it under any circumstances.

“Maintaining cross-browser compatibility for common base functionality in a shared library by several experts seems like a good idea to me. The bulk of your argument seems to be on whether or not these people are experts, but I’m curious if you oppose the idea in general.”

Virtually none of the “major libraries” are cross-browser (and fewer still are written by people who can genuinely be considered experts.)

Comment by DavidMark — July 26, 2009

@Eyelidlessness:

“So do handles. Many of us don’t intend to become “famous” programmers and don’t act as the mouthpiece for some project or another, and so choose to remain anonymous on the Internet.”

What does that mean? Most of the fishy handles *are* mouthpieces for one project or another. That’s why they hide their identities.

http://en.wikipedia.org/wiki/Shill

“That said, nothing is preventing you from researching the handles of people you interact with the same way you research the “real” names they claim to have.”

Nothing, except my complete non-interest in researching handles. I don’t have to research real names as I know who is who in this business.

“If you really feel you need to know more about me before you consider my opinions, lmgtfy.”

Not interested.

“Seriously, you come across as a self-important asshole. Talking down to people, as you’ve done here and in linked areas of the Internet, is off-putting and detracts from whatever point you’re trying to make. Did your parents never teach you that you’ll get more flies with honey?”

Now I see the misconception. I’m not really talking to you at all. This is a public forum. The people who should take notice are those paying for incompetent efforts. I’m also talking to the frauds churning out these libraries. They are definitely listening as they keep appropriating my code and ideas. Notice not one of them is in here defending their libraries. They tried in the past and it always backfired.

It’s ironic. When I first started pointing out the futility of scripts like Prototype and jQuery, the typical naive response was “where’s your cool library?” As if writing and giving away a general-purpose library was a prerequisite to judge code quality. One of my main points was (and is) that GP JS libraries are a bad idea (deploying JS on the Web is nothing like distributing desktop software, JS is not assembler, jQuery is not C++, etc.)

Eventually, I posted one. You can believe it was light years ahead of any of the “majors.” In fact, many have copied various bits of it. Then it was “aw, you are just jealous coz nobody is using your library!” That’s the loopy mindset and it is pretty out of place in this discipline.

So you’ve got these guys who clearly can’t think straight, downloading “plug-ins” to stack on top of scripts like jQuery, which are in a constant state of flux. It’s one of the reasons that the Web is such a mess and that people think of cross-browser scripting as impossible. I really don’t care if such people like me or not. I’m tired of tripping over their lousy scripts at every turn on the Web. I don’t like the idea of them ripping off companies and ruining the reputation of the language either.

Comment by DavidMark — July 26, 2009

@eyelidlessness:

Your latest comment was such a great one, I especially liked that part.

Did your parents never teach you that you’ll get more flies with honey?

I don’t think his parents ever teach him what is politeness and respect, and to finish
please do not feed the troll anymore, seriously this guy is just a moron.

Comment by SleepyCod — July 27, 2009

@SleepyCod
“Your latest comment was such a great one, I especially liked that part.”

Wake up, sleepy. Your library is a joke and years too late (see the BBC’s entry as well.) I don’t care if that hurts your feelings. I have to consider the general public.

Please don’t write any more libraries until you learn basic browser scripting. That’s the same thing I asked of Resig, so I’m not singling you out or anything.

And get a real name. Nobody is going to listen to a fish.

Comment by DavidMark — July 27, 2009

@SleepyCod

There is no denying that David Mark’s tone is often abrasive but dismissing him as a moron because he has criticised your work is childish. You would be better off swallowing your pride and reading through some of the comp.lang.javascript threads linked here.

Comment by timdown — July 27, 2009

@timdown:

There is no denying that David Mark’s tone is often abrasive but dismissing him as a moron because he has criticised your work is childish

It surely is, but you know I felt so good after that, believe me, you wouldn’t be happy if someone treated you as a Javascript illiterate, don’t you?

Comment by SleepyCod — July 27, 2009

Hello,

will you use the HTML5 or the Safari DnD API?
They’re pretty close to each otehr but I think the Safari DnD API is quite complete and mature and is, as far as I know, the only complete and safe one.

Safety is a key: it has killed all MSIE attempts at providing a stable API because security holes got fixed too often… and among the safety traps, the MSIE folks suggested me quite many traps when going out from web to local: since your content is local it could start execute quite an amount of things when, e.g., being edited within an editor that accepts WMF or even HTML.

Last I heard of firefox’s developer previews, going from local content (I’m more interested to contents such as fragments or images than files) was impossible.

paul

Comment by polx — July 27, 2009

@polx – bravo!

Comment by sixtyseconds — July 27, 2009

@SleepyCod – is there a demo available?

Comment by WillPeavy — July 27, 2009

DavidMark,

“What does that mean? Most of the fishy handles *are* mouthpieces for one project or another. That’s why they hide their identities.”

9_9 You’re not entitled to know people’s identities regardless of the reason they’re posting. I’m not “hiding” anything from you by using a handle.

“Nothing, except my complete non-interest in researching handles.”

Right after you got done explaining the reason you don’t take handles seriously is because you can research “real” names?

“I don’t have to research real names as I know who is who in this business.”

Then you should know their handles too. See how silly this is?

“Not interested.”

Good.

“Now I see the misconception. I’m not really talking to you at all.”

I didn’t say you were. In fact, I pretty much said you weren’t, and ought to be. If your concern is that “frauds” are “defrauding” the “public”, and you believe you have some unique or valuable insight into this “fraud”, don’t you have the responsibility to educate the “public”? Isn’t part of that responsibility not making extra sure you’ll be dismissed because you can’t be bothered to treat other people with respect?

“They are definitely listening as they keep appropriating my code and ideas.”

[citation needed]

“Notice not one of them is in here defending their libraries. They tried in the past and it always backfired.”

Delusions of grandeur? No one is defending their libraries because no one takes you seriously. Is anyone besides me even bothering to take anything you say at face value? I’m doing it because I think you have a point worth making, and I wish you’d make it instead of insulting people and making asinine allusions about the greatness about your Internet member.

“It’s ironic. When I first started pointing out the futility of scripts like Prototype and jQuery, the typical naive response was “where’s your cool library?” As if writing and giving away a general-purpose library was a prerequisite to judge code quality.”

From what I can tell, the response is that no one’s going to take some guy’s word for it about how bad a successful library is. They’re asking for some credibility to the claim—whether that credibility is generated by a coherent critique, or by reputation (the latter of which, in my opinion, would be giving you or anyone else *too much credit*).

“One of my main points was (and is) that GP JS libraries are a bad idea (deploying JS on the Web is nothing like distributing desktop software, JS is not assembler, jQuery is not C++, etc.)

Eventually, I posted one.”

So you’re a hypocrite?

“You can believe it was light years ahead of any of the “majors.””

Forgive me if I’m not inclined to just take your word for it. How’s about we see it?

“Then it was “aw, you are just jealous coz nobody is using your library!””

Not seeing any of that here nor in the linked context.

“So you’ve got these guys who clearly can’t think straight, downloading “plug-ins” to stack on top of scripts like jQuery, which are in a constant state of flux. It’s one of the reasons that the Web is such a mess and that people think of cross-browser scripting as impossible.”

Really? Say what you want about the whole jQuery-extension nightmare, but by and large the web today is leaps and bounds more reliable—in terms of functionality, stability, cross-browser support, and a trend toward accessibility and good practices—than it was before Prototype and jQuery were created. There is a lot that needs improvement, but it’s just flatly wrong to say that the web is worse for it; it’s just not as much of a walled garden as it used to be.

“I really don’t care if such people like me or not. I’m tired of tripping over their lousy scripts at every turn on the Web.”

Who’s stealing whose code now?

“I don’t like the idea of them ripping off companies”

Which companies have been ripped off?

“and ruining the reputation of the language either.”

The language has a much better reputation now than anytime in the past. It’s now considered a platform for serious application development. That’s since Prototype and jQuery.

Comment by eyelidlessness — July 27, 2009

“seriously this guy is just a moron”

And you ask me not to feed the troll? What I said to sixtyseconds earlier is still relevant: Look. This is the Internet. People are going to be acerbic. Get over it and pick out what they mean to say. In other words, be the bigger person. You’ll relieve needless stress, you’ll learn more, and you’ll eventually crowd them out by being able to relay what they’re saying without the bile.

You’re not doing yourself or anyone else any favors by being defensive.

Comment by eyelidlessness — July 27, 2009

@timdown:
“There is no denying that David Mark’s tone is often abrasive”

Well, it took a lot of harsh abrasives to put a dent in this mess. Not done yet, of course…

Comment by DavidMark — July 28, 2009

@eyelidlessness:
“9_9 You’re not entitled to know people’s identities regardless of the reason they’re posting. I’m not “hiding” anything from you by using a handle.”

You are hiding your identity from the world. That puts a serious dent in your credibility. Perhaps you are just being silly or perhaps you are less than confident in your message.

“Right after you got done explaining the reason you don’t take handles seriously is because you can research “real” names?”

Didn’t say anything like that. And I’d like to add that these blog comments are the least effective form of communication since paper airplanes. It’s no way to exchange ideas.

“Then you should know their handles too. See how silly this is?”

That’s complete nonsense. I generally don’t take to handles. I’ve made an exception in your case as you seem to have something on the ball (an exception for handles.)

“I didn’t say you were. In fact, I pretty much said you weren’t, and ought to be. If your concern is that “frauds” are “defrauding” the “public”, and you believe you have some unique or valuable insight into this “fraud”, don’t you have the responsibility to educate the “public”?”

LOL. What do you think I have been doing here? You’ve been an enormous help BTW, which is truly surprising. This site is usually good for nothing but shrillibusters against anyone who speaks out against lousy scripts like jQuery and the futility of building with them on the Web.

“So you’re a hypocrite?”

Obviously not. I *never* promoted it. On the contrary, I told people not to use it, but rather to learn from it. The primary lesson was that the “major” libraries were doing virtually everything wrong. For those paying attention, browsers came and went over the years, yet my library needed virtually no maintenance. Contrast that with the “majors.” Constantly updating and re-testing huge, complicated and inter-dependent scripts is expensive, especially for those who don’t understand the first thing about what goes on under their hoods. Get it? You really should read CLJ more often. ;) Alternatively, read the jQuery forums. Seems most “programmers” who use jQuery do not even own debuggers (including the authors.) It’s not pretty and the experience should shock you back to reality.

“[citation needed]”

Yes, you really should get out more. This site is not a good source of information on the state of browser scripting.

“Delusions of grandeur? No one is defending their libraries because no one takes you seriously.”

I could just keep repeating the same line for each of these comments. Do you follow anything but what Ajaxian reports? Nobody serious takes the information on this site seriously.

“Forgive me if I’m not inclined to just take your word for it. How’s about we see it?”

LOL. We?! You must be the only one in the industry who missed it. You can see attempts to mimic the code in virtually all of the “majors” today (especially jQuery’s latest attempt(s) at competence.) If you missed the original Web app, you’ve been out to lunch for almost two years.

“Not seeing any of that here nor in the linked context.”

See above. You’ll have to do your own research. You can find lots of similar sentiments posted on *this* site. It’s the standard knee-jerk (emphasis on jerk) reaction. Seriously, where *have* you been?

“Delusions of grandeur? No one is defending their libraries because no one takes you seriously.”

Once again, many of them ventured to CLJ to defend their scripts. At least one link has been posted here that leads to Resig’s flailings. Search CLJ’s archives for lots more. It only made them look sillier and they seemingly learned very little from the experience.

“Really? Say what you want about the whole jQuery-extension nightmare, but by and large the web today is leaps and bounds more reliable—in terms of functionality, stability, cross-browser support, and a trend toward accessibility and good practices—than it was before Prototype and jQuery were created. There is a lot that needs improvement, but it’s just flatly wrong to say that the web is worse for it; it’s just not as much of a walled garden as it used to be.”

Nope, as of two years ago, they were all using UA-based browser sniffing, which was known to be unusable as early as 1998. Scripts like jQuery have moved on to the next step in the learning curve, which is sniffing by object inference. Perhaps you should read a bit before making wild stabs in the dark.

“From what I can tell, the response is that no one’s going to take some guy’s word for it about how bad a successful library is.”

Some guy?! Search the CLJ archive for jQuery and reserve a few days in your schedule to review the various reviews. And no need to take anyone’s word for any of this as there are plenty of clear examples. The failings of these scripts (not to mention the fallacies in the accompanying books) are easily demonstrable. Take some time and do some research. What could it hurt?

“Who’s stealing whose code now?”

That makes no sense in context. What are you trying to say?

“Which companies have been ripped off?”

Anybody who has paid for a public Website and gotten jQuery (or the like) on the side has been ripped off (and so have their users.) This is true whether they know it or not (and they don’t in most cases as they leave such decisions to the “experts”).

“The language has a much better reputation now than anytime in the past. It’s now considered a platform for serious application development. That’s since Prototype and jQuery.”

The rise of JS happened in *spite* of such follies. One thing is certain, you can’t build a “serious application” with something like jQuery. The only people saying differently are either hopelessly deluded or selling “serious jQuery applications.”

Comment by DavidMark — July 28, 2009

Oh, I missed this.

“You’ve been an enormous help BTW, which is truly surprising.”

I don’t know why it’s surprising. I’m quite a bit more polite than you, which is astonishing.

Comment by eyelidlessness — July 28, 2009

@eyelidlessness:
“Why on earth are you “tripping over their lousy scripts at every turn on the Web” if you aren’t using their code?”

Because I have to *use* the Web like everyone else. These scripts typically get in the way. For instance, ever try to sign up for Reddit at 800×600? Try it and watch some silly jQuery “modal” foil every attempt until you adjust your monitor settings. That’s one fairly typical example. These sites usually eat my PC’s resources alive as well, which is very irritating as they don’t usually do anything special to justify such an intrusion. And, of course, turning scripting off is not usually an option (due to incompetent designs.)

“As a matter of fact, as far as I know I uniquely occupy this particular handle, whereas I use a fairly common name in “real” life, which itself is not my legal name (which I share with a highly paid professional athlete)”

Okay, fair enough, but couldn’t you have used a middle initial or something?

“Really? So, if a client requests a set of functionality, and they receive that functionality, the fact that jQuery was used would somehow invalidate receipt of that functionality?”

Yes, absolutely. The script is full of mistakes and constantly patched. For example, take any site built with jQuery 1.2x (lots of them in the last couple of years.) At some point, the developers realized they had designed a time bomb and rewrote large chunks of code that was too complicated for most of the sites to begin with. This placed an undue burden on the site owners who should not have had to upgrade and re-test such a beast in their site’s lifetime. And, of course, 1.3x (two strikes so far) is nowhere near competent at this point and the authors keep piling more junk on top of it. It’s positively ludicrous as proper cross-browser scripting techniques have been around for a decade. As with most of these scripts, they are designed to work in a handful of modern desktop browsers in their default configurations. That’s how they are tested and approved, yet the Web features a far more diverse set of environments. A good example would be IE6, which jQuery has never come close to handling properly. They talk about discontinuing support for it every other month. Odd for a popular browser that has been out for a decade. Also, try disabling ActiveX for the Web (a fairly common configuration in corporate environments) in any version of IE and watch half the Web break as jQuery falls flat on its face. Doesn’t get much more futile than that. And I don’t mean harmless script errors, I mean unusable documents as jQuery provides no mechanism for feature detection and progressive enhancement (save for a half dozen useless flags, which change meaning every other release and are largely ignored by app developers anyway.)

“And just happened to make such “follies” great successes in the process? That’s quite an unlikely coincidence.”

Depends on your perspective. Success is relative. I put it to you that jQuery, Prototype, etc. are miserable failures at what they set out to do. They do *not* make browser scripting easier. They only provide an illusion that fools the uninitiated (their target market.) How can anything that fouls up attributes/properties, IE without ActiveX, IE in quirks mode, etc. be considered successful in this area? They just multiply the complications, as evidenced in their support forums and the myriad examples detailed in CLJ.

“…who so far has demonstrated to me only that he knows the difference between properties and attributes…”

LOL. You are still on page one. Keep reading…

“What I saw on the linked archives was you yelling at a bunch of people, and those people being disinterested in dealing with your tone.”

You saw nothing of the sort. I’ve never YELLED at anyone there. As for disinterest, you seem to be cherry-picking the responses from jQuery fans, who were part of the problem, not part of the solution. Keep reading and you’ll find that many of them changed their tone over the years. This was hardly an overnight process. Many others agreed all along but were tired of arguing about jQuery and Prototype by the time I took up the cause. It’s all part of the public record for those who care to look…

This comment interface is making this conversation too hard to follow. In short, do some research. CLJ is an excellent place to start. Search for “jQuery” or “Prototype” or “MooTools” and read what other professionals have to say about them. It will scare you straight. ;)

Comment by DavidMark — July 28, 2009

I should add that searching for “Prototype” will be pretty futile. What an unfortunate name, especially considering its attempts to implement *classical* inheritance in JS.

Comment by DavidMark — July 28, 2009

“Because I have to *use* the Web like everyone else. These scripts typically get in the way. For instance, ever try to sign up for Reddit at 800×600? Try it and watch some silly jQuery “modal” foil every attempt until you adjust your monitor settings. That’s one fairly typical example. These sites usually eat my PC’s resources alive as well, which is very irritating as they don’t usually do anything special to justify such an intrusion. And, of course, turning scripting off is not usually an option (due to incompetent designs.)”

I guess I misunderstood. You’re tripping over their louse applications. I thought you were actually reading their scripts and busting a vein in your forehead.

Sure. Eye C Lidlessness. 9_9 Seriously, accept the fact that you’re not entitled to know personal identification details of people you interact with in an anonymous context.

“Yes, absolutely.”

You’re kidding. So, if a client pays a developer to develop functionality, and that functionality is developed and works, the client got ripped off because there’s a library you don’t like in use? Really? Really? Doesn’t, um, the fact that the functionality works count for a heck of a lot more than whether or not you like jQuery?

“[a whole bunch of unsubstantiated claims about the ins and outs of jQuery internals]”

“Depends on your perspective.”

You’re claiming that JS has become popular quite despite the libraries that have become *popular* in the course of JS becoming popular. That is the meaning of success that I’m discussing. How is it possible for JS to become popular quite despite the libraries that became popular in the course of JS becoming popular? Thinking about it again, it’s not just an unlikely coincidence, it’s a logical impossibility. On the question of whether these libraries propelled or hindered JS’ popularity, the success of other pursuits of those libraries is beside the point.

“LOL. You are still on page one. Keep reading…”

I’m still waiting for a compelling reason. Not to mention a link to your library and some documentation of other library authors grabbing code from it. Still waiting.

“You saw nothing of the sort.”

Oh. 9_9

Comment by eyelidlessness — July 28, 2009

WordPress eats content. :(

Comment by eyelidlessness — July 28, 2009

@DavidMark

I think you could get your points across better here by requiring less effort of your readers. It’s true that you and others have made many well-reasoned criticisms of jQuery and other libraries on CLJ that can be accessed by searching the archive. However, it takes a lot of effort for someone new to CLJ to get to the nub of the technical arguments in amongst all the other stuff, and many people simply will not bother.

One thing CLJ proves is that you spend *a lot* of time arguing against libraries like jQuery. Who do you want to influence? If you want to influence more people, then perhaps you could write an article or articles with your criticisms and publish it/them on the internet. That would be something you and others could point people to, which would in the end save you time and effort.

Finally, your ‘My Library’ was something public that backed up your credibility and the fact that you have taken down the public site for it is unfortunate, though I’m sure you had your reasons.

Comment by timdown — July 28, 2009

Leave a comment

You must be logged in to post a comment.