From:  Bill McCloskey <wmccloskey@mozilla.com>
Date:  19 May 2016 04:38:40 Hong Kong Time
Newsgroup:  news.mozilla.org/mozilla.dev.tech.js-engine.internals
Subject:  

Re: componentization and specialization, was Re: Clang-format

NNTP-Posting-Host:  63.245.214.181

I think we're starting to conflate separate concepts. I absolutely believe
that code should be modular. SpiderMonkey is a great example: we're much
more productive because of how well separated it is from the rest of the
browser. On the other hand, *people* should not be modular. You don't need
to be ignorant of one area in order to be an expert at another.

I find that when I first learn a piece of code, it takes forever to learn
the basic invariants and high-level abstractions. But once you learn those
things, it goes much quicker. When you see a function call, you can guess
what it does rather than having to look at the definition. When you debug a
problem, you know the point where things go wrong because you know how the
data is supposed to look (and not look). And the great thing about this
sort of high-level knowledge is that it stays with you for a long time. I
forgot most of what I knew about the JS engine a while ago, but it's still
easy for me to look up specific things that I need to know or to debug
issues that relate to SpiderMonkey.

I don't think there's any reason why a JS engine developer couldn't learn
this high-level stuff about other parts of Gecko or Firefox while still
being a great JS engineer. Yes, it takes some time. But it pays huge
dividends. When test failures happen, you'll find it a lot easier to
understand what's going wrong and who would be the best person to
investigate. It saves tons of time in the long run.

I suspect one reason that SpiderMonkey developers have such a dim view of
the rest of Gecko is that they usually only look at it when dealing with
test failures that are standing in the way of landing something. That's
going to be a pretty frustrating experience no matter what the overall
quality of Gecko is. And tests tend not to be our best code.

Perhaps a better approach to learning other parts of Gecko is to pick a fun
thing that you want to do in Firefox and try to do it. Some of the code
you'll find will be bad and some of it will be good. The important part is
that Firefox code will start to seem like more of an end in itself rather
than a roadblock to a SpiderMonkey improvement.

On Wed, May 18, 2016 at 11:14 AM, Steve Fink  wrote:

> On a related note, I think we're also organizationally weak about taking
> advantage of ideas and new approaches. Specifically, you can come up with
> all the great ideas you want, as long as you're going to personally
> implement them. Anything that would best be done by someone else or a
> collaboration of multiple people requires strong salesmanship, which is not
> always the forté of the person coming up with the idea. But I've rambled on
> too long already, so I'm not going to get into that.
>

Working with people in other areas is a great way to earn their respect.
Once they respect you, they'll be much more likely to work with you on your
ideas. Or you might not even need their help because you can do the work
yourself. Either way, having more experience in other areas makes it easier
to try out new things.

-Bill