News to Hackers?

D

David Mark

What a bunch of fools. Topped by one of the Cappuccino (!)
promoters. He didn't care for my "superficial" review of Cappuccino
and, of course, thinks anyone with a complaint about a JS library has
an evil agenda.

http://news.ycombinator.com/item?id=993300

Cappuccino. That's something built on top of Sproutcore, right? No
need to get any deeper than that.

I don't care to create an account with "Hacker News", so I will
respond here.

"Ah yes, David Mark. This guy trashes other JavaScript frameworks
(usually quite pedantically) in order to promote his own "My Library".
Not a good strategy if you ask me."

Always a conspiracy with these people. So, instead of looking at the
code in question, they change the subject.

"Use a dollar sign anywhere in your code and David Mark will declare
you an incompetent fool."

I never talk about such minutiae. Why would I when there are far more
glaring problems to address?

"I'm far too much of a generalist to consider myself a JavaScript
expert. However, even I can pick out a number of items in his lib that
shouldn't have been handled the way they are:

He declares $ in a global context without first checking for its
existence"

So? The builder told you not to include the $ feature. If it steps
on jQuery, too bad. Don't mash multiple GP libraries into one
document. :)

"He uses RegExp objects constantly -- in 50 different places in his
full "mylib.js" -- including in cases where a simple indexOf would be
better"

Fifty huh?

", and, best yet, he doesn't bother to cache them in any of the dozen
or so cases that I examined."

So? It's still much faster then virtually everything else out there
(pick any task).

"Wasn't that one of his criticisms of someone else's code?"

No.

"His treatment of camelCase is truly embarrassing, relying on an ugly
RegExp every time it's called. Try something like this instead:"

I'll skip the ingenious suggestion to cache camel-cases.

"If Resig is incompetent, then 99.99% of Javascript coders should quit
immediately. Maybe 100%."

Pity, it seems that way.

"It's sad that one person can destroy an entire community. But one
can."

Oh, there I go again. Which community have I destroyed now? :)

"According to his LinkedIn, David Mark is now working at Sitepen, the
primary contributors to Dojo. I guess he no longer believes that all
JavaScript frameworks are completely idiotic..."

I don't follow that at all. And notice the fixation on me, rather
than jQuery. They'll never learn that way. ;)

"Therefore, I'm sad to admit that, in this case, he almost has a
point. The use of attr('height') to mean not the height attribute in
the DOM but as an alias for height() smells wrong to me. However, it's
clear that he has absolutely no intention of becoming a productive
contributor to jQuery or helping in any way."

Of course not. It's not fixable. Ask Matt Kruse. ;)

"By contrast, let's take a minute to appreciate this Matt Kruse
fellow. He has apparently strong objections to something in jQuery's
design and is taking it to John Resig."

....after I pointed it out to him.

"He seems ready to engage in a real dialogue. The end result? He
probably ends up a little happier and jQuery ends up a little better."

Nope. Didn't happen that way at all. Resig got really confused and
started bitching about "drama" in the mailing list. End result:
nothing changed.

"The real question is: how can we have more Matt Kruses and fewer
David Marks in the world? Do the David Marks of world drive off the
Matt Kruses? (I think they almost certainly do.) Why are there so many
sociopathic personalities in circles such as this, and how do we
mitigate the damage they cause?"

Oh brother. On the Internet, everyone's a psychiatrist. Can't seem
to follow basic cause and effect either.

"In my experience perhaps the only way of dealing with characters like
David Marks is by completely ignoring their contributions."

Like an ostrich does? If you can't see the bugs, they can't bite you?


"David Mark is an anti-jQuery crusader. He is known for speaking ill
of people who use the library as well as the developers (John Resig in
particular). He insists that jQuery is responsible for all of the
sites across the internet that have JavaScript errors."

All of them? That sounds like a gross misinterpretation.

"What I don't understand is why he doesn't work to help jQuery to be
better then and contribute a bit? If its causing errors and bugs then
certainly he could help some instead of complaining?

Resig +1 Mark -1"

These rubes have no idea where the better ideas in jQuery come from,
do they? ;) And contribute directly? Their idiotic moderator banned
me after one post. They don't like to hear they are wrong about
anything as it could affect their popularity. Of course, the
dwindling posts to their mailing list suggest people are starting to
notice the results don't add up.

"He (David Mark) isn't going to get much support with his attitude."

Who's looking for support? I do enjoy publicity immensely though.
For every 1000 crackpots out there, there are a handful that actually
get the message.

(Speaking of My Library).

"It's not all that usable ITRW."

Had to look that one up. And, of course, it is In the Real World.
The phrase is so popular, they've coined a shorthand version. Use at
the risk of sounding like a drooling jackass. And is there really
some other world where jQuery's logic makes sense?

"I'd like to see him write cross browser key-event handling code
without doing UA sniffing. Honestly, I would like that. He committed
an attempt to a branch of Dojo but it's not in service and doesn't
actually work."

LOL. BTDT. There's a rendition in My Library, Too. And I didn't do
anything to Dojo's keyboard handling (except rip out the browser
sniffing). I've recommended the keyboard bits be re-designed and
replaced (likely with my rendition). But, of course, there's always
that backward compatibility specter.

"Or, to put it in more childish terms, "if you're so smart, let's see
you do it.""

Where's _your_ cool JS library? Then when they find out there is one,
it's "aw, UR just jealous of jQuery". :)

"His arguments are nonsensical. Are there bugs in jQuery? To be sure."

Why is it they always seek to defuse the situation by stipulating that
there are indeed bugs? Some bugs are mistakes, others indicate
incompetence on the part of the authors. You've got to be able to
tell the difference.

"But he has absolutely no clue what real developers are looking for in
a library."

I see. Real Developers that live in the Real World (and use jQuery).

"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 even close. That's the last thing I would worry about. You know
you are effective when people start making up lies to deflect
scrutiny.

"Not only does jQuery not claim to support those browsers,"

Regardless, who cares what they claim to "support". Are users with
older browsers supposed to be privy to that list? You can't degrade
browsers by press release. :)

"there are literally no web developers using jQuery who care about
support for those browsers."

So? It was their made-up point of contention.

And, of course, some other rube ran with it.

"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."

No idea what any of that means, except that this guy likes jQuery and
has conned others into thinking there is a market for _his_ services.

"I remember reading one of his rants from a while back, and it
actually caught me off guard. I know quite a bit about javascript, but
the way he was talking made me think I was perhaps missing the boat. I
looked into what he was saying, and some of it was sort of accurate,
but not really relevant.

I think he just has angry-hyperactively-perfectionist-armchair-
developer syndrome.

Case in point: where is his brilliant contribution to the JavaScript
ecosystem?"

Aw, where's my cool JS library?

"There are so many better outlets, anyone who's feeling trapped on
comp.lang.javascript should just go somewhere else.

I think it's a bold claim to say that David's understanding of the DOM
is "significantly deeper" than John's. Especially considering that the
DOM is not a particularly complex set of APIs."

Perhaps it is more complex than they think. Resig sure seems to be
lost. ;)

"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."

Resig thinks he uses feature testing. What little bit there is to be
found in jQuery can be found (almost verbatim in most cases) in My
Library. He'd still be sniffing the UA string if I hadn't published
that.

"However, most JS coders are too busy using jQuery or Prototype or
something to Get Their Project Done and then move on to the next thing
to be bothered by this guy."

They like CAPS, don't they? This one is going into my brochure with
other bonehead remarks from disingenuous developers.

"It's hard to find much validity, especially when it starts to boil
down to comments like "As I recall, it seemed needlessly complex." He
long ago formed the opinion that all libraries were shit, and
apparently made that basis on how complex the code seemed and other
superficial reasons."

As I recall, I didn't say that. Hard to say without context.

"I actually had to go and google the person in question. After about
five or so newsgroup messages from him badmouthing other people I gave
up.

Still no idea who he is."

No? You sure won't catch me Googling this guy.

"There is always some guy, I've never heard of, being an asshole on
any given topic on the Internet."

Sometimes whole bands of them. ;)
 
R

Ross Boucher

LOL. BTDT. There's a rendition in My Library, Too. And I didn't do
anything to Dojo's keyboard handling (except rip out the browser
sniffing). I've recommended the keyboard bits be re-designed and
replaced (likely with my rendition). But, of course, there's always
that backward compatibility specter.

Enlighten us. Show me this brilliant code in MyLibrary that handles
cross browser keyboard events using feature detection.
 
D

David Mark

Enlighten us. Show me this brilliant code in MyLibrary that handles
cross browser keyboard events using feature detection.

Sorry for the confusion. Read carefully and you will see that I am
referring to the sequel. I have a spec script as described (keyboard
monitor), but it looks like it will be optioned. :)

So if you want one, you'll have to buy it. Or you can give the matter
some more thought as it doesn't require much in the way of feature
detection.
 
R

Ross Boucher

Sorry for the confusion.  Read carefully and you will see that I am
referring to the sequel.  I have a spec script as described (keyboard
monitor), but it looks like it will be optioned.  :)

So if you want one, you'll have to buy it.  Or you can give the matter
some more thought as it doesn't require much in the way of feature
detection.

Please explain to me how, using feature detection, you can account for
the fact that Safari only repeats keydown events for arrow keys, while
Firefox only repeats keypress events for arrow keys.
 
D

David Mark

Please explain to me how, using feature detection, you can account for
the fact that Safari only repeats keydown events for arrow keys, while
Firefox only repeats keypress events for arrow keys.

Tricky. :)

But seriously, your observations are clearly incorrect and I can't be
baited into helping you for free.

I verified in IE8, FF3.5, Safari 4 and Chrome. By default, my design
suppresses duplicate _mousedown_ events. That way you can use a timer
and be consistent with whatever it is your app is repeating (until you
get the matching keyup).

So, I pressed and help the down arrow for roughly a half second to a
second, twice.

Log from FF3.5:-

Key down at test1: 40
Key up at test1: 40 duration: 744
Key down at test1: 40
Key up at test1: 40 duration: 1098

From Safari (Chrome is identical in this respect):-

Key down at test1: 40
Key up at test1: 40 duration: 801
Key down at test1: 40
Key up at test1: 40 duration: 1130

From IE:-

Key down at test1: 40
Key up at test1: 40 duration: 531
Key down at test1: 40
Key up at test1: 40 duration: 1719

(Yes, I held the second a bit longer in IE to make sure there were no
repeats).

I've previously tested in Opera back to 8 and IE back to 6. It would
seem to be perfect (though I won't go that far yet). :)

And yes, it passes the ms held. So it's suitable for a video game
interface (among other things). And you can turn off the duplicate
keydown suppression (not recommended for obvious reasons), and no, the
feature does not interfere with typematic repeats at all (for what
should also be obvious reasons). In the final analysis, I remember I
was surprised at how trivial the code turned out. As mentioned, there
is virtually no feature detection involved. As as often the case, the
initial design is everything (so don't foul up there).

Also, you'll notice there is no keypress event fired for arrow keys
(among others). Dammit, I'm helping you now. That's enough
hints. :) If you want the script, you can (probably) license it.
Contact me by email.
 
D

David Mark

[...]
I verified in IE8, FF3.5, Safari 4 and Chrome.  By default, my design
suppresses duplicate _mousedown_ events.

Typo: _keydown_ obviously. Too much going on today. :)
 
T

Thomas 'PointedEars' Lahn

Ross said:
Please explain to me how, using feature detection, you can account for
the fact that Safari only repeats keydown events for arrow keys, while
Firefox only repeats keypress events for arrow keys.

Possibility: You're wrong. I have just tested in Firefox/Iceweasel 3.5.5
(for answering <that this
browser does not repeat a `keypress' event for a single press of any arrow
key on my keyboard. (If that is what you meant.)

Test code (for Firebug) was:

var i = 0;
document.onkeypress = function() {
console.log(++i);
};

(It is the same with

document.addEventListener("keypress", function() { ... }, false);

..)


PointedEars
 
R

Ross Boucher

Possibility: You're wrong.  I have just tested in Firefox/Iceweasel 3.5..5
(for answering <that this
browser does not repeat a `keypress' event for a single press of any arrow
key on my keyboard.  (If that is what you meant.)

Firefox repeats ONLY the keypress event. Safari repeats ONLY the
keydown event. Next time please read more carefully.
 
D

David Mark

Firefox repeats ONLY the keypress event. Safari repeats ONLY the
keydown event. Next time please read more carefully.

Rubbish. And stop thinking in terms of browser A vs. browser B.
You'll never graduate from sniffing like that. ;)

In FF, with dupe prevention turned off in my script:-

Key down at test1: 40
Key down at test1: 40
Key down at test1: 40
Key down at test1: 40
Key down at test1: 40
Key down at test1: 40
Key down at test1: 40
Key down at test1: 40
Key down at test1: 40
Key down at test1: 40
Key up at test1: 40 duration: 33
 
R

Ross Boucher

Rubbish.  And stop thinking in terms of browser A vs. browser B.
You'll never graduate from sniffing like that.  ;)

In FF, with dupe prevention turned off in my script:-

Key down at test1: 40
Key down at test1: 40
Key down at test1: 40
Key down at test1: 40
Key down at test1: 40
Key down at test1: 40
Key down at test1: 40
Key down at test1: 40
Key down at test1: 40
Key down at test1: 40
Key up at test1: 40 duration: 33

The behavior is different on Mac and Windows.
 
T

Thomas 'PointedEars' Lahn

Ross said:
Firefox repeats ONLY the keypress event.

I just told you that nothing is repeated there. Can't you read?
Safari repeats ONLY the keydown event.

I have not debated that, however confirmation of that statement is still
pending.
Next time please read more carefully.

Next time be precise. In my book, nothing is repeated here, and you are
wrong.


PointedEars
 
R

Ross Boucher

Using a timer to simulate the repeat event has problems of its own.
Most notably, it ignores the user specified values for repeat delay
and rate.

I'm also curious to know why, if:
But seriously, your observations are clearly incorrect and I can't be
baited into helping you for free.

You bother participating in comp.lang.JavaScript at all. Surely nobody
is paying you to be here.
 
D

David Mark

Using a timer to simulate the repeat event has problems of its own.

Bull-f-ing-shit. It's not a simulation of anything. It's whatever
your code wants to repeat while the key is down. You are in complete
control of it. ;)
Most notably, it ignores the user specified values for repeat delay
and rate.

Doesn't matter at all. You aren't writing an OS in JS are you? As
for the user, they are oblivious. Their OS still works the way they
configured it (unless you are rude enough to start canceling keyboard
events!)
I'm also curious to know why, if:

I don't think you are curious at all.
You bother participating in comp.lang.JavaScript at all.
And?

Surely nobody
is paying you to be here.

So? That means I should just give you anything I happen to write?
 
R

Ross Boucher

Bull-f-ing-shit.  It's not a simulation of anything.  It's whatever
your code wants to repeat while the key is down.  You are in complete
control of it.  ;)


Doesn't matter at all.  You aren't writing an OS in JS are you?  As
for the user, they are oblivious.  Their OS still works the way they
configured it (unless you are rude enough to start canceling keyboard
events!

Perhaps it doesn't matter for your use case, that doesn't mean it
doesn't matter to other people.
I don't think you are curious at all.





So?  That means I should just give you anything I happen to write?

I never suggested you give me anything. But here you are, spending
your time responding to threads in a highly critical way, with little
constructive feedback.

If you're uninterested in helping people, or doing anything other than
be snarky, I honestly don't know why you bother. I think that the
timeout approach to repeat events is an interesting one. But you could
have, several messages ago, simply said that instead of wasting
everyone's time calling them dumb.

In any number of cases, rather than demonstrate your awesome
superiority with a snide remark, you could have taken the same amount
of time to offer an actual programming idea, and then people would be
thankful instead of "fixating" on your "evil agenda".
 
D

David Mark

Perhaps it doesn't matter for your use case, that doesn't mean it
doesn't matter to other people.

People who single-mindedly steer into walls because of perceived
issues? And, as mentioned, your observations about FF are incorrect
and (furthermore), the duplicate keydown abatement is optional.
I never suggested you give me anything.

What was that bit about enlightening you?
But here you are, spending
your time responding to threads in a highly critical way, with little
constructive feedback.

Responding to threads? Who started this thread? You responded and I
actually gave you a few hints. :)
If you're uninterested in helping people, or doing anything other than
be snarky,

I've never met anyone in my life who used that word to describe
anything. Read programmers in blog comments (or whatever) and it
comes up every other sentence. FWIW, it's not a "cool" thing to say.
I honestly don't know why you bother.

I don't know why you bother pondering why I do anything. You remind
me of Matt Kruse.
I think that the
timeout approach to repeat events is an interesting one.

Great! But I don't agree that a timeout (interval?) has anything to
do with my design. What you do between keydown and the corresponding
keyup is your business.
But you could
have, several messages ago, simply said that instead of wasting
everyone's time calling them dumb.

See, there's the rub. You say things like "snarky" and then you start
putting words in _my_ mouth. When did I say you were dumb?

And whose time did I waste? You asked:-

"Please explain to me how, using feature detection, you can account
for the fact that Safari only repeats keydown events for arrow keys,
while Firefox only repeats keypress events for arrow keys."

I answered you in the _very next_ post. So please stop wasting
everyone's time with your fantasies about the last hour's worth of
posts. They are all there in black and white for everyone to see.
In any number of cases, rather than demonstrate your awesome
superiority with a snide remark, you could have taken the same amount
of time to offer an actual programming idea, and then people would be
thankful instead of "fixating" on your "evil agenda".

Any number of cases? You made some stupid remark (about me)
elsewhere, which I responded to. Then you come around here and start
baiting with cracks about "brilliant code" and whatnot. Did you
really think that would result in help from me? ISTM you are just
bitching now because your "strategy" didn't pay off. ;)
 
R

Ross Boucher

David, this started with you calling me out in this post:
http://groups.google.com/group/comp.lang.javascript/browse_thread/thread/44bb4805cc4d9cf8

Admittedly, its difficult to follow threads across multiple sites. But
in between that post, the one on hacker news, and this, you've
repeatedly called me a fool, and someone who doesn't know what I'm
talking about.

The question I asked was a related but simplified version of the
problem in the Closure code. So, in reality, what I'm saying is you
should have offered *any* alternate approach to that problem in the
original thread, rather than just complain about how stupid I and
everyone on the google closure team must be.

In response to your comment about the timeout/interval, you're
response to my question now seems to be that you think firing
repeating key events isn't a feature the browser or the framework
should offer. In other words, you're just pretending the problem
doesn't exist. You may not see the utility of having this be a
framework level feature, the fact that it exists in pretty much every
desktop development framework suggests that reasonable people
disagree.
 
D

David Mark

David, this started with you calling me out in this post:http://groups.google.com/group/comp.lang.javascript/browse_thread/thr...

I know that. Nothing personal. I'm just sick of seeing people shoot
themselves in the foot. Mainly because I have to browse the Web too
and their misfires often interfere.
Admittedly, its difficult to follow threads across multiple sites. But
in between that post, the one on hacker news, and this, you've
repeatedly called me a fool, and someone who doesn't know what I'm
talking about.

Bullshit. I called everyone involved in GoogClosure fools (and they
are). WTF are you thinking wasting time on that? And don't get me
started on that other thing. Sproutcore is on the same level as
GoogClosure (i.e. hopelessly outdated).

As for you not knowing what you are talking about. That was in
response to your comment about me on that ridiculous "hacker" site.
The only way I recognized you at all was from your cite.
The question I asked was a related but simplified version of the
problem in the Closure code.

Asked in their forum? Yes, I vaguely remember that.
So, in reality, what I'm saying is you
should have offered *any* alternate approach to that problem in the
original thread, rather than just complain about how stupid I and
everyone on the google closure team must be.

That forum is moderated. Moderators tend to be the lowest common
denominator posters and therefore incapable of moderating
discussions. They should only exist to filter spam. ;)
In response to your comment about the timeout/interval, you're
response to my question now seems to be that you think firing
repeating key events isn't a feature the browser or the framework
should offer.

The browser? How could any piece of software not feature typematic
repeats? As for a script, it's not possible to regulate repeats,
except as I have done with my design. Most mistakes in browser
scripting stem from untenable (and typically over-ambitious) designs.
Stop and think and you will realize that nobody is going to care if
your JS widget exactly matches the OS typematic rate on unprintable
characters (e.g. arrows). The typical JS wodget is lucky if it
initializes without throwing an exception. ;)
In other words, you're just pretending the problem
doesn't exist.

In other words, you are trying to cling to the idea that you weren't
wrong about browser sniffing after all (see also IFrame shims,
translucent PNG's). It won't fly. It hasn't flown since the
mid-90's.
You may not see the utility of having this be a
framework level feature, the fact that it exists in pretty much every
desktop development framework suggests that reasonable people
disagree.

What the hell is a desktop development framework? And reasonable
people would realize that my design does not interfere with typematic
features at all. You can deal with the stream of duplicated keydown
events in your app if you really want to. But I can tell you it is
the wrong strategy (for reasons you seem to be partially conscious
of). ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top