Live data from Hacker News

I'll sue you if you use my common-sense JavaScript tests

groups.google.com

41–50 of 82 posts

Re: I'll sue you if you use my common-sense JavaScript tests

#41

Earlier quoted context omitted.

And yet I can't help drawing a parallel: comp.lang.lisp was famously full of the hateful spewing of an intolerant contributor, and for that both the group and the contributor (Erik Naggum) were basically worshipped by a non-trivial community. Why did Lisp produce that outcome, while JavaScript produces this?

It's basically the same. comp.lang.lisp and Erik Naggum may've been worshipped by a non-trivial community, but it was still a small community. The rest of us still hated it. I'm sure there're people out there that enjoy comp.lang.javascript too.

And as a simple perusal of threads that David has posted in shows, he has he fair share of 'you're absolutely right David, jQuery, mootools and all the rest suck' style worshipping.

For some reason (which I could make guesses at) Usenet attracts this type of kookery, and when kooks gather, they tend to create this appearance that people actually value their rants and conspiracies.

As a result, you get the perceived 'Erik is god' views of comp.lang.lisp, whereas people that try to read, or contribute, consider(ed) him and his ilk as a deterrent to useful discussion.

Re: I'll sue you if you use my common-sense JavaScript tests

#42
post #2

Some other gems by David Mark http://groups.google.com/group/comp.lang.javascript/browse_f... http://groups.google.com/group/comp.lang.javascript/browse_t...

I think he has a few points. If you disagree with some of his points, argue why.

FWIW, I also view js libraries with skepticism. I'm not convinced they're a net gain for the web. (I'm talking about general purpose libs. UI libs obviously provide value).

There's this misconception that working with the DOM is hard, or can't be done in a cross browser way without bolting on a big js lib.

Even something as simple as a closure is routinely packaged up in a js lib as .bind() why??? Add to that the fact they usually do silly things like convert arguments to an Array etc just to slow you down some more.

When you see news stories like "js lib X latest release is 5 times as fast as previous version!" You should not think 'wow that's great'. You should think 'jesus christ how could they have written it so slow to start with? How do I know they've written it properly this time? Time to stop using js lib X'

Re: I'll sue you if you use my common-sense JavaScript tests

#43
post #42
post #2

Some other gems by David Mark http://groups.google.com/group/comp.lang.javascript/browse_f... http://groups.google.com/group/comp.lang.javascript/browse_t...

I think he has a few points. If you disagree with some of his points, argue why. FWIW, I also view js libraries with skepticism. I'm not convinced they're a net gain for the web. (I'm talking about general purpose libs. UI libs obviously provide value). There's this misconception that working with the DOM is hard, or can't be done in a cross browser way without bolting on a big js lib. Even something as simple as a c…

This just sounds like you haven't used jQuery yet. Then you'll know why.

Re: I'll sue you if you use my common-sense JavaScript tests

#44
post #42

Earlier quoted context omitted.

I think he has a few points. If you disagree with some of his points, argue why. FWIW, I also view js libraries with skepticism. I'm not convinced they're a net gain for the web. (I'm talking about general purpose libs. UI libs obviously provide value). There's this misconception that working with the DOM is hard, or can't be done in a cross browser way without bolting on a big js lib. Even something as simple as a c…

This just sounds like you haven't used jQuery yet. Then you'll know why.

I've seen jQuery code. It doesn't do anything particularly useful for me.

It solves problems I don't have. I don't need to lookup elements in the dom, because I put them there. I already know where they are.

I don't need a slow .bind() method - I know how to write closures.

Look at one of the top news items - jQuery plugin 'behavior'. It just doesn't make any sense.

Look at some of the source code. For example .addClass(). It's the most general you could imagine - can take a list of classes, or a function. Yet I'm betting most of the time it's being called with a single class to add. There's a lot of wasted checks and effort in there. It's checking the type, it's splitting the string on " ", it's checking to see the class isn't already listed etc etc

Also everything is assuming it's operating on a list of elements - cue wasteful for loops when they're not needed.

So, when you do the seemingly simple

  $('#myelement').addClass("foo");
it'll be cycling through the array of elements of length 1, splitting 'foo' on spaces, checking if 'foo' is a function, etc etc etc etc

Those are precious wasted cycles. And for what? so you can write:

  $('#myelement').addClass("foo");
instead of:

  // I already have a js ref to myElement thanks,
  // and know myElement doesn't already have 'foo' in className
  myElement.className+=" foo";

Re: I'll sue you if you use my common-sense JavaScript tests

#45
post #10

Earlier quoted context omitted.

Thanks for digging these up. His tone and his arguments are two different things; I find his tone hard to take, but can any JS coders weigh in on his arguments?

His arguments are nonsensical. Are there bugs in jQuery? To be sure. But he has absolutely no clue what real developers are looking for in a library. Many of the complaints in his critiques center around the fact that jQuery does things which will break browsers like Netscape 4 and IE 5. Not only does jQuery not claim to support those browsers, there are literally no web developers using jQuery who care about support…

Exactly. I would never pretend my code would run on anything less than IE6 or any brand of ancient Netscape. I'd love to know which browsers shipping today fail on:

window.blah === undefined

and require the more verbose equivalent I've seen pushed on c.l.j:

typeof window.blah === "undefined"

There's simply no market left for this sort of paleo-Javascript.

Re: I'll sue you if you use my common-sense JavaScript tests

#46

Seems like this David Mark is mad at the world: http://sixrevisions.com/javascript/promising_javascript_fram... http://sixrevisions.com/javascript/promising_javascript_fram... http://stackoverflow.com/users/88658/david-mark http://help.wugnet.com/bravenet/webmaster/Great-Examples-cod...

Thanks for digging these up. His tone and his arguments are two different things; I find his tone hard to take, but can any JS coders weigh in on his arguments?

The good side of David Mark: I have read plenty of his stuff on comp.lang.javascript over some time, and my own JavaScript is good enough to tell that his understanding is deep and his code intelligent and thorough. I would say his knowledge of the DOM and how to code for it is significantly deeper than John Resig's, lending weight to his criticisms. He has been working on Dojo and I am certain his input will improve it significantly.

The bad side: he consistently antagonises people, has what seems to be a personal vendetta against jQuery and declines to publish useful, constructive critiques, instead posting ill-formatted, snide rants dressed up as code reviews on comp.lang.javascript. His behaviour towards John Resig has resulted in Resig claiming to have turned his back entirely on comp.lang.javascript, which is great shame because I think there is a lot he could learn there to improve jQuery. If David Mark's attacks are turning people away from comp.lang.javascript, then that is unfortunate because he is by no means the only expert on there and others experts on there will have less of an audience for their insightful posts.

Re: I'll sue you if you use my common-sense JavaScript tests

#47
post #10

Earlier quoted context omitted.

His arguments are nonsensical. Are there bugs in jQuery? To be sure. But he has absolutely no clue what real developers are looking for in a library. Many of the complaints in his critiques center around the fact that jQuery does things which will break browsers like Netscape 4 and IE 5. Not only does jQuery not claim to support those browsers, there are literally no web developers using jQuery who care about support…

Exactly. I would never pretend my code would run on anything less than IE6 or any brand of ancient Netscape. I'd love to know which browsers shipping today fail on: window.blah === undefined and require the more verbose equivalent I've seen pushed on c.l.j: typeof window.blah === "undefined" There's simply no market left for this sort of paleo-Javascript.

For that specific case, the more verbose version is definitely better, since the undefined property of the global object can be altered. For example, this silently redefines it for the whole page:

if (undefined = someVar) {...}

The typeof check cannot be broken in this way.

Re: I'll sue you if you use my common-sense JavaScript tests

#48
The worst kind of trolls are the ones that are knowledgeable and articulate, but arrogant, dogmatic crusaders.

Many programming mailing lists I've been on ended up acquiring somebody like this, at which point I usually have to unsubscribe in order to resist the temptation to get into pointless flamewars.

Re: I'll sue you if you use my common-sense JavaScript tests

#49
post #21

Earlier quoted context omitted.

Thanks for digging these up. His tone and his arguments are two different things; I find his tone hard to take, but can any JS coders weigh in on his arguments?

One of his quotes 'Every time a new browser version is released, anything built on them has to be re-tested due to an inexplicable reliance on the user agent string'. Not really most libraries use feature testing, especially jQuery and John advocates feature testing in quite a few of his writings.

His point is more subtle - you can do browser detection based on user agent strings, feature detect, conditional script inclusion, even css hacks which set styles that can be read from javascript. His point (such that it is) is that these are all bad ideas.

Instead of detecting which browser you are using based on which features you support, the script should check to see if the features it wants to use exist, and if so use them.

So, instead of:

   var isIE = !!document.all;
   function doSomething()
   {
     if (isIE) document.all.whatever();
   }
You do:

   if (document.all)
   {
       function doSomething()
       {
           document.all.whatever();
       }
   }
Even closer to the point, he means that these are both bad form:

    var isIE = navigator.userAgent.ssubstr...;
    var isIE = !!document.all;

Re: I'll sue you if you use my common-sense JavaScript tests

#50
post #44

Earlier quoted context omitted.

This just sounds like you haven't used jQuery yet. Then you'll know why.

I've seen jQuery code. It doesn't do anything particularly useful for me. It solves problems I don't have. I don't need to lookup elements in the dom, because I put them there. I already know where they are. I don't need a slow .bind() method - I know how to write closures. Look at one of the top news items - jQuery plugin 'behavior'. It just doesn't make any sense. Look at some of the source code. For example .addCl…

You make some fair points.

I believe jQuery's strength is that it allows you to accomplish things neatly without needing to know the sins and virtues of Javascript....

The point is that there are plenty of both.

Post reply on HN