From:  Sean Stangl <sstangl@mozilla.com>
Date:  13 Oct 2017 04:32:55 Hong Kong Time
Newsgroup:  news.mozilla.org/mozilla.dev.tech.js-engine.internals
Subject:  

Re: C++ coding style rule for keeping class fields together

NNTP-Posting-Host:  63.245.214.181

> Is there a definition of "reasonable-sized" ?

If a class is sufficiently complex, comprehension can be impeded if the
methods are "far" from the definitions of the data they act on. Such a
class would be "unreasonably-sized."

The distinction is based on how many logical "pieces" of the struct you can
comfortably maintain in your short-term memory.

On Thu, Oct 12, 2017 at 10:16 AM,  wrote:

> Hello,
>
> On Monday, October 2, 2017 at 5:04:27 PM UTC+2, Jason Orendorff wrote:
> > Thanks, everyone.
> >
> > Since there seems to be as much consensus about this as there ever is, I
> > went ahead and made the change.
> >
> > "For reasonable-sized classes, put all the fields together, at the top,
> > immediately after any necessary typedefs. For unreasonably large classes,
> > do whatever seems best (but let's try to avoid making more of these)."
> >
> > https://wiki.mozilla.org/JavaScript:SpiderMonkey:Coding_Style#Classes
>
> Is there a definition of "reasonable-sized" ?
>
> Thanks
> Sylvestre
> _______________________________________________
> dev-tech-js-engine-internals mailing list
> dev-tech-js-engine-internals@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals
>