Re: Proposal: Change the coding style guide to allow an 'o' prefix to indicate out-params

2014-12-06 Thread Aryeh Gregor
On Sat, Dec 6, 2014 at 1:31 AM, Botond Ballo wrote: > In APZ code, we've been using the prefix 'aOut' for out-parameters. This > keeps them consistent with the general rule of "'a' for arguments" while > identifying out-parameters with a convention. This is what I'm accustomed to as well. I pr

Re: Proposal: Change the coding style guide to allow an 'o' prefix to indicate out-params

2014-12-06 Thread Xidorn Quan
On Thu, Dec 4, 2014 at 11:28 AM, Robert O'Callahan wrote: > On Thu, Dec 4, 2014 at 12:35 PM, Seth Fowler wrote: > > > I’d like to change the coding style guide to let us make out-params more > > obvious by using an ‘o’ prefix for their name instead of an ‘a’. For > > example, > > > > nsresult Mo

Re: Proposal: Change the coding style guide to allow an 'o' prefix to indicate out-params

2014-12-05 Thread Seth Fowler
ying out-parameters with a convention. > > Cheers, > Botond > > - Original Message - >> From: "Nicholas Nethercote" >> To: "Robert O'Callahan" >> Cc: "dev-platform" , "Seth Fowler" >> >> Sent: Friday,

Re: Proposal: Change the coding style guide to allow an 'o' prefix to indicate out-params

2014-12-05 Thread Botond Ballo
holas Nethercote" > To: "Robert O'Callahan" > Cc: "dev-platform" , "Seth Fowler" > > Sent: Friday, December 5, 2014 5:10:09 PM > Subject: Re: Proposal: Change the coding style guide to allow an 'o' prefix > toindicate o

Re: Proposal: Change the coding style guide to allow an 'o' prefix to indicate out-params

2014-12-05 Thread Nicholas Nethercote
You sometimes see comments for this, e.g. int foo(int aX, /* out */ char* aS); If we recommended/required this, it might make the interregnum period problem smaller? Nick On Fri, Dec 5, 2014 at 1:31 PM, Robert O'Callahan wrote: > On Fri, Dec 5, 2014 at 12:08 PM, Seth Fowler wrote: > >> Well

Re: Proposal: Change the coding style guide to allow an 'o' prefix to indicate out-params

2014-12-05 Thread Robert O'Callahan
On Fri, Dec 5, 2014 at 12:08 PM, Seth Fowler wrote: > Well, converting all existing code to use this convention overnight > definitely wouldn’t be worth it. And just adding this to the style guide > will give us very little benefit *right now*. But I think if we add this to > the coding style gui

Re: Proposal: Change the coding style guide to allow an 'o' prefix to indicate out-params

2014-12-05 Thread Seth Fowler
> On Dec 4, 2014, at 10:53 AM, L. David Baron wrote: > > If we adopt this convention, should we also have a convention for an > in-out param? (If so, what?) I considered proposing the ‘io’ prefix for this, but I was worried it would lead to bike shedding. =) I’d definitely support that, thoug

Re: Proposal: Change the coding style guide to allow an 'o' prefix to indicate out-params

2014-12-05 Thread Seth Fowler
> On Dec 4, 2014, at 11:02 AM, Eric Rescorla wrote: > In contrast, Seth's suggestion would be an extremely clear indication > that a parameter is an outparam. > > Yes, and because it's just a convention and not compiler enforced it can > also be wrong. I don’t know of any realistic, usable way

Re: Proposal: Change the coding style guide to allow an 'o' prefix to indicate out-params

2014-12-05 Thread Seth Fowler
> On Dec 4, 2014, at 11:28 AM, Robert O'Callahan wrote: > > I think this would be a slight improvement but the place where I really want > out-parameters to be visible is at the caller, not the callee. Agreed! The simplest way to achieve that in C++, though, is to use pointer arguments (so th

Re: Proposal: Change the coding style guide to allow an 'o' prefix to indicate out-params

2014-12-04 Thread Robert O'Callahan
On Thu, Dec 4, 2014 at 12:35 PM, Seth Fowler wrote: > I’d like to change the coding style guide to let us make out-params more > obvious by using an ‘o’ prefix for their name instead of an ‘a’. For > example, > > nsresult Modify(int aCount, size_t aSize, char* oResult); > > This will make it clea

Re: Proposal: Change the coding style guide to allow an 'o' prefix to indicate out-params

2014-12-04 Thread Martin Thomson
> On 2014-12-04, at 10:51, Nicholas Nethercote wrote: > >> What fraction of these cases can't be distinguished by making non-out >> ref/pointer parameters const? > > The non-const-ness of a parameter is a weak, indirect indication that > it's an outparam, and one that is probably not consistent

Re: Proposal: Change the coding style guide to allow an 'o' prefix to indicate out-params

2014-12-04 Thread Eric Rescorla
On Thu, Dec 4, 2014 at 10:51 AM, Nicholas Nethercote wrote: > On Fri, Dec 5, 2014 at 5:41 AM, Eric Rescorla wrote: > > > >> I’d like to change the coding style guide to let us make out-params more > >> obvious by using an ‘o’ prefix for their name instead of an ‘a’. For > >> example, > > > > Wha

Re: Proposal: Change the coding style guide to allow an 'o' prefix to indicate out-params

2014-12-04 Thread Ben Kelly
I typically append "Out" to these parameter names. The o prefix would be more concise. +1 Thanks! Ben - Original Message - From: "Seth Fowler" To: "dev-platform" Sent: Thursday, December 4, 2014 1:35:06 PM Subject: Proposal: Change the coding style g

Re: Proposal: Change the coding style guide to allow an 'o' prefix to indicate out-params

2014-12-04 Thread L. David Baron
On Thursday 2014-12-04 10:35 -0800, Seth Fowler wrote: > I’d like to change the coding style guide to let us make out-params more > obvious by using an ‘o’ prefix for their name instead of an ‘a’. For example, > > nsresult Modify(int aCount, size_t aSize, char* oResult); > > This will make it cl

Re: Proposal: Change the coding style guide to allow an 'o' prefix to indicate out-params

2014-12-04 Thread Nicholas Nethercote
On Fri, Dec 5, 2014 at 5:41 AM, Eric Rescorla wrote: > >> I’d like to change the coding style guide to let us make out-params more >> obvious by using an ‘o’ prefix for their name instead of an ‘a’. For >> example, > > What fraction of these cases can't be distinguished by making non-out > ref/poi

Re: Proposal: Change the coding style guide to allow an 'o' prefix to indicate out-params

2014-12-04 Thread Eric Rescorla
On Thu, Dec 4, 2014 at 10:35 AM, Seth Fowler wrote: > I’d like to change the coding style guide to let us make out-params more > obvious by using an ‘o’ prefix for their name instead of an ‘a’. For > example, > > nsresult Modify(int aCount, size_t aSize, char* oResult); > > This will make it clea

Proposal: Change the coding style guide to allow an 'o' prefix to indicate out-params

2014-12-04 Thread Seth Fowler
I’d like to change the coding style guide to let us make out-params more obvious by using an ‘o’ prefix for their name instead of an ‘a’. For example, nsresult Modify(int aCount, size_t aSize, char* oResult); This will make it clear just from the declaration of a function or method which parame