Re: On the usefulness of style guides (Was: style guide proposal)

2014-01-02 Thread Nicholas Nethercote
On Thu, Jan 2, 2014 at 1:44 PM, Ehsan Akhgari wrote: >> >> The sad part is JS used to be C. Its idiosyncratic C++ rules could have >> been inherited from Gecko instead. > > FWIW this is the earliest version of the SpiderMonkey coding style document > that I can find, dating back to 2006: >

Re: On the usefulness of style guides (Was: style guide proposal)

2014-01-02 Thread Ehsan Akhgari
On 12/25/2013, 4:46 PM, Mike Hommey wrote: On Wed, Dec 25, 2013 at 10:00:33PM +1300, Robert O'Callahan wrote: The JS engine has always been a problem when trying to enforce consistent standards across Gecko. Part of that comes from it being viewed as an independent product, much more so than any

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-25 Thread Mike Hommey
On Wed, Dec 25, 2013 at 10:00:33PM +1300, Robert O'Callahan wrote: > The JS engine has always been a problem when trying to enforce consistent > standards across Gecko. Part of that comes from it being viewed as an > independent product, much more so than any other Gecko module. Another part > of t

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-25 Thread Robert O'Callahan
On Wed, Dec 25, 2013 at 11:54 AM, Nicholas Nethercote < n.netherc...@gmail.com> wrote: > On Mon, Dec 23, 2013 at 8:45 PM, Robert O'Callahan > wrote: > > That's a mistake. Module owners don't have the authority to make up their > > own style. Who has been doing this? > > I was under the impression

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-24 Thread Nicholas Nethercote
On Mon, Dec 23, 2013 at 8:45 PM, Robert O'Callahan wrote: > > That's a mistake. Module owners don't have the authority to make up their > own style. Who has been doing this? I was under the impression that they did have that authority, though I can't find written evidence for it right now. MFBT

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-23 Thread Robert O'Callahan
I think the best way to expend energy on this topic would be to work on tools. https://bugzilla.mozilla.org/show_bug.cgi?id=875605 seems worth getting over the line. Some other kind of checker, possibly based on clang-format, could also be a fine alternative. Just get something working that is con

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-23 Thread Robert O'Callahan
On Fri, Dec 20, 2013 at 2:35 PM, Jeff Gilbert wrote: > Personally, there are a couple of things I don't like about moz-style > (though revisions to the central style guide at least have made it better > than it used to be), but instead of bikeshedding the central style guide, > we just do our own

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-20 Thread Neil
Ms2ger wrote: On 12/20/2013 10:55 AM, Neil wrote: I thought that it was pretty clear which smart pointer to use: That makes it quite clear it isn't clear: nsCOMPtr - interfaces nsRefPtr - concrete types RefPtr - code imported from WebKit HTH MXR claims we have three types named RefPtr. O

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-20 Thread Chris Peterson
On 12/19/13, 6:50 PM, Bobby Holley wrote: And that should include accepting patches to fix the style across their >module. ;-) > FWIW I'm totally fine with mass-conversions if people want to do them. Any mass conversions of code style should coincide with the next ESR release. Imagine the pr

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-20 Thread Ms2ger
On 12/20/2013 10:55 AM, Neil wrote: Brian Smith wrote: In PSM, we created some scoped pointer wrapper types around NSS data structures (ScopedNSSTypes.h), which are based on the MFBT scoped pointers. And, consequently, PSM has standardized on MFBT smart pointers throughout the module (there sho

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-20 Thread Nicolas B. Pierron
On 12/19/2013 09:57 AM, Till Schneidereit wrote: I think we should do more than encourage: we should back out for all style guide violations. Period. We could even enforce that during upload to a review tool, perhaps. Is this a guide or a rule? From my point of view, this is a guide, which is

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-20 Thread Neil
Ehsan Akhgari wrote: To be very specific, here's a number of examples of things which our code base doesn't agree on: 1. Line endings Which is probably the easiest and least controversial thing to check for. I blame whoever it was who decided to include a vim that defaults to DOS line endi

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-20 Thread Neil
Brian Smith wrote: In PSM, we created some scoped pointer wrapper types around NSS data structures (ScopedNSSTypes.h), which are based on the MFBT scoped pointers. And, consequently, PSM has standardized on MFBT smart pointers throughout the module (there should be nsRefPtr in PSM, only RefPt

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-19 Thread L. David Baron
On Thursday 2013-12-19 17:11 -0500, Ehsan Akhgari wrote: > See, that right there is the root problem! Programmers tend to care > too much about their favorite styles. I used to be like that but > over the years I've mostly stopped caring about which style is > better, and what I want now is consi

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-19 Thread Anthony Jones
On 20/12/13 14:35, Jeff Gilbert wrote: > How do patches get fully-reviewed if the sum-knowledge of the > reviewers doesn't include whether the style's right? Alternatively, > who is signing off on the content of code, having in-depth knowledge > of how it works, but not knowing the style? That soun

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-19 Thread Ehsan Akhgari
On 12/19/2013, 9:36 PM, Brian Smith wrote: On Thu, Dec 19, 2013 at 6:13 PM, Ehsan Akhgari mailto:ehsan.akhg...@gmail.com>> wrote: But to address the main point of this paragraph, what's wrong with having *one* style that *everybody* follows? I can't tell if you have something agains

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-19 Thread Bobby Holley
On Thu, Dec 19, 2013 at 6:18 PM, Ehsan Akhgari wrote: > > But my point is that we should establish and > >> document an _ideal_ style for all of Gecko, and that module owners >> should make every effort to converge on that style (even if they don't >> like parts of it), rather than using the exist

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-19 Thread Ehsan Akhgari
On 12/19/2013, 9:40 PM, Nicholas Nethercote wrote: On Thu, Dec 19, 2013 at 6:32 PM, Chris Peterson wrote: I like #3. The common style subset is probably small, but since it is common, it will be uncontroversial and require no bikeshedding. :) I suspect it would be tiny. I recently had to mo

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-19 Thread Nicholas Nethercote
On Thu, Dec 19, 2013 at 6:32 PM, Chris Peterson wrote: > > I like #3. The common style subset is probably small, but since it is > common, it will be uncontroversial and require no bikeshedding. :) I suspect it would be tiny. I recently had to move a function from SpiderMonkey to Gecko. It was

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-19 Thread Brian Smith
On Thu, Dec 19, 2013 at 6:13 PM, Ehsan Akhgari wrote: > But to address the main point of this paragraph, what's wrong with having > *one* style that *everybody* follows? I can't tell if you have something > against that, or if you just care about a small subset of the tree and are > happy with th

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-19 Thread Chris Peterson
On 12/19/13, 5:35 PM, Jeff Gilbert wrote: The last bit of the problem is that*all of Gecko* is currently 'files with existing styles', so I'm not sure how that can mesh with having 'one true style' unless we have an initiative to actually convert over all mis-styled files. If we either fail

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-19 Thread Ehsan Akhgari
On 12/19/2013, 9:05 PM, Bobby Holley wrote: That aside, what you describe sounds like 'too many' styles, almost definitionally, if it's such a major pain. However, there are quantities between 'one' and 'many', so I don't think that because 'too many' is clearly bad, we have to ch

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-19 Thread Ehsan Akhgari
On 12/19/2013, 8:35 PM, Jeff Gilbert wrote: How do patches get fully-reviewed if the sum-knowledge of the reviewers doesn't include whether the style's right? Alternatively, who is signing off on the content of code, having in-depth knowledge of how it works, but not knowing the style? That so

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-19 Thread Bobby Holley
On Thu, Dec 19, 2013 at 5:35 PM, Jeff Gilbert wrote: > How do patches get fully-reviewed if the sum-knowledge of the reviewers > doesn't include whether the style's right? Alternatively, who is signing > off on the content of code, having in-depth knowledge of how it works, but > not knowing the

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-19 Thread Jeff Gilbert
e with almost all of it, but there are a couple of points with which I really don't. - Original Message - From: "Bobby Holley" To: "Jeff Gilbert" Cc: "Ehsan Akhgari" , "Till Schneidereit" , "Martin Thomson" , "Gregory Szorc" ,

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-19 Thread Ehsan Akhgari
I mistakenly sent this only to Jeff: On Thu, Dec 19, 2013 at 6:29 PM, Ehsan Akhgari wrote: > On 12/19/2013, 5:29 PM, Jeff Gilbert wrote: > >> It's compromise. I think we can take it as given that we'll never all >> agree on one way to do things, so instead, different modules do their own >> thing

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-19 Thread Nicholas Nethercote
I agree violently with Ehsan and Bobby. Per-module styles are an enormous hassle. (Storage and MFBT are two that come to mind.) Nick ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-19 Thread smaug
On 12/20/2013 12:11 AM, Ehsan Akhgari wrote: On 12/19/2013, 12:57 PM, Till Schneidereit wrote: I think we should do more than encourage: we should back out for all style guide violations. Period. We could even enforce that during upload to a review tool, perhaps. However. This has to be done on

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-19 Thread Martin Thomson
"Bobby Holley" , "Andrea Marchesini" , "Mike Hommey" , dev-platform@lists.mozilla.org Sent: Thursday, December 19, 2013 2:29:27 PM Subject: Re: On the usefulness of style guides (Was: style guide proposal) It's compromise. I think we can take it as given

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-19 Thread Bobby Holley
On Thu, Dec 19, 2013 at 2:29 PM, Jeff Gilbert wrote: > I posit that there's probably not much benefit to having, say, style for > dom/ match style for gfx/, since precious-few people often deal with both > at once. > I don't agree at all. I own XPConnect, which is one of the most stylistically-

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-19 Thread Jeff Gilbert
ereit" , "Martin Thomson" Cc: "Gregory Szorc" , "Nicholas Nethercote" , "Bobby Holley" , "Andrea Marchesini" , "Mike Hommey" , dev-platform@lists.mozilla.org Sent: Thursday, December 19, 2013 2:11:52 PM Subject: Re: On the usefulness

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-19 Thread Ehsan Akhgari
On 12/19/2013, 12:57 PM, Till Schneidereit wrote: I think we should do more than encourage: we should back out for all style guide violations. Period. We could even enforce that during upload to a review tool, perhaps. However. This has to be done on a per-module basis (or even more fine-grained

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-19 Thread Till Schneidereit
ot; > Cc: "Till Schneidereit" , "Mike Hommey" < > m...@glandium.org>, "Ehsan Akhgari" , > dev-platform@lists.mozilla.org, "Andrea Marchesini" < > amarches...@mozilla.com> > Sent: Thursday, December 19, 2013 9:43:34 AM > Subject: On the u

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-19 Thread Martin Thomson
a template for that. - Original Message - From: "Bobby Holley" To: "Martin Thomson" Cc: "Till Schneidereit" , "Mike Hommey" , "Ehsan Akhgari" , dev-platform@lists.mozilla.org, "Andrea Marchesini" Sent: Thursday, December 19

On the usefulness of style guides (Was: style guide proposal)

2013-12-19 Thread Bobby Holley
Attempting to fork the thread. Please reply here if you want to bikeshed on this topic in general. On Thu, Dec 19, 2013 at 9:38 AM, Martin Thomson wrote: > Here's what I've done for the last few projects I've been on: > > * Taken the off-the-shelf formatter. > * Taken the default configurati