On Wednesday 2017-05-10 13:10 +0200, Emilio Cobos Álvarez wrote:
> On Tue, May 09, 2017 at 06:56:03PM -0700, L. David Baron wrote:
> > On Wednesday 2017-05-10 02:43 +0200, Emilio Cobos Álvarez wrote:
> > > The issue I have with per-type conventions is that it doesn't scale very
> > > well, specially when you're writing new code (and more specially if
> > > they're not documented in the style guide).
> > > 
> > > What should the convention be for `ServoStyleSet` (which is what
> > > triggered this thread)? Who decides that, and based on which arguments?
> > 
> > In this particular case, I think it's easy.  ServoStyleSet is the
> > Stylo version of a class (nsStyleSet) that uses pointer conventions
> > because it used to implement XPCOM interfaces.  We shouldn't treat
> > the two style set classes differently.  So it should be passed with
> > pointers, not references.
> 
> I didn't know that nsStyleSet was previously an XPCOM interface. Does
> that mean that stuff like nsStyleContext, etc shouldn't be
> passed/returned by reference either in your opinion? (just realised it
> was also an XPCOM interface at the time).
> 
> I think we shouldn't need to do code archeology in order to find out if
> we can use references or not in the code.

It doesn't require code archaeology; it just requires observing that
all the existing code uses pointers rather than references, and
therefore that you should be consistent with that.

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                          https://www.mozilla.org/   𝄂
             Before I built a wall I'd ask to know
             What I was walling in or walling out,
             And to whom I was like to give offense.
               - Robert Frost, Mending Wall (1914)

Attachment: signature.asc
Description: PGP signature

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to