Live data from Hacker News

Learning from Twitter

ejohn.org

1–10 of 37 posts

Re: Learning from Twitter

#3
post #2

Why isn't John a billionaire already?

Heh, while I assume that this was mostly rhetorical and largely tongue-in-cheek it is a question that I've been pondering lately. (Or, more accurately, thinking about what work excites me.)

I've been working on jQuery full-time now for about 1.5 years (sponsored by my employer, Mozilla). Prior to that I worked on jQuery in my spare time for about 4 years while doing other things (I was in college, then in Y Combinator - Summer 2006, and then worked for Mozilla as a JavaScript Evangelist).

I've managed to pigeon-hole myself into the position of a JavaScript framework maintainer rather solidly (for better or worse).

That being said I really enjoy what I do and have trouble thinking of something that I would rather do as my day job. Being able to work on a piece of code that I've largely written from scratch and promote it to a community of eager users is my dream. I've often thought about making a leap into something else but struggle to think of something that would hold my interest as deeply.

I'm largely not interested in starting or joining a business. For whatever reason I frequently find that attaching a profit motive to work largely impedes my ability to be happy and seems to run contrary to my overall goals (educating people, giving good tools to developers -- and providing both to anyone and everyone, no restriction).

Perhaps I'll find some interesting project some day that will open the financial floodgates (or perhaps I'll enter a situation -- such as having children -- that will necessitate me earning more than I do now) but I'm quite content now where I am, doing what I'm doing.

All this being said, I'm constantly looking at and exploring new things. At the moment though most of that is outside the realm of JavaScript, or even computers, and mostly relating to art. It's unclear to me if that's something that'll hold my long-term interest (although it has for the past few years) but we shall see.

Re: Learning from Twitter

#4
I use a generic version of the waiting-for-pause trick:

    // execute callback only after a pause in user input; the function returned
    // can be used to handle an event type that tightly repeats (such as typing
    // or scrolling events); it will execute the callback only if the given timout
    // period has passed since the last time the same event fired
    function createOnPause(callback, timeout, _this) {
        return function(e) {
            var _that = this;
            if (arguments.callee.timer)
                clearTimeout(arguments.callee.timer);
            arguments.callee.timer = setTimeout(function() { 
                callback.call(_this || _that, e);
            }, timeout);
        }
    }
Use it like this:

    document.addEventListener('scroll', createOnPause(function(e) {
        // do something interesting here
    }, 1500, this), false);
Edit: Oops! The version in the article runs some code if any scroll event occurred since it last fired, but this one doesn't execute the callback until the user stops scrolling for some amount of time. Anyway, maybe it's still useful for some folks.

Re: Learning from Twitter

#5
It's good to know that this situation will lead to improvements in jQuery.

However, I'm disappointed in how twitter, or more accurately, Dustin Diaz handled this situation. They identified some performance issues. Narrowed it down to a jQuery version but just left it there.

jQuery is open source so they could have done some investigating on their own and tried to narrow down what changed in that selector. Especially since this change was blogged about (as mentioned by John).

Not to mention various people helped out twitter by finding some pretty obvious flaws and made suggestions. Twitter has a lot of resources and I'm assuming a lot of talented Javascript engineers. This is a situation where they could have used their resources to contribute to an open source project instead of the other way around.

Re: Learning from Twitter

#6
post #3
post #2

Why isn't John a billionaire already?

Heh, while I assume that this was mostly rhetorical and largely tongue-in-cheek it is a question that I've been pondering lately. (Or, more accurately, thinking about what work excites me.) I've been working on jQuery full-time now for about 1.5 years (sponsored by my employer, Mozilla). Prior to that I worked on jQuery in my spare time for about 4 years while doing other things (I was in college, then in Y Combinato…

I didn't know you were part of a YC company. Which one was it?

Re: Learning from Twitter

#7

It's good to know that this situation will lead to improvements in jQuery. However, I'm disappointed in how twitter, or more accurately, Dustin Diaz handled this situation. They identified some performance issues. Narrowed it down to a jQuery version but just left it there. jQuery is open source so they could have done some investigating on their own and tried to narrow down what changed in that selector. Especially…

I don't think it's fair yet to say that Twitter won't do these things. The first step was fixing the regression as fast as possible.

Re: Learning from Twitter

#8
>since scrolling itself didn't change the DOM

Scrolling did indirectly change the DOM as you load more tweets when you scroll. But the point here is that the actual scrolling is not changing the DOM, the append is, and that's probably when you should update your query cache.

Re: Learning from Twitter

#9
post #7

It's good to know that this situation will lead to improvements in jQuery. However, I'm disappointed in how twitter, or more accurately, Dustin Diaz handled this situation. They identified some performance issues. Narrowed it down to a jQuery version but just left it there. jQuery is open source so they could have done some investigating on their own and tried to narrow down what changed in that selector. Especially…

I don't think it's fair yet to say that Twitter won't do these things. The first step was fixing the regression as fast as possible.

Well there's not much else to do. It seems other people did most of the work for them.

Re: Learning from Twitter

#10
post #7

It's good to know that this situation will lead to improvements in jQuery. However, I'm disappointed in how twitter, or more accurately, Dustin Diaz handled this situation. They identified some performance issues. Narrowed it down to a jQuery version but just left it there. jQuery is open source so they could have done some investigating on their own and tried to narrow down what changed in that selector. Especially…

I don't think it's fair yet to say that Twitter won't do these things. The first step was fixing the regression as fast as possible.

And the second step was writing a highly-visible blog post slagging the free code they use in their many-million-dollar website before they actually understood the problem?
Post reply on HN