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 clear just from the declaration of a function or method 
> which parameters are out-params. XPCOM requires us to use out-params a lot, 
> and I’ve found that determining when it’s happening often requires me to look 
> at the code for the method, especially since we frequently use pointer 
> arguments for efficiency or because the argument is optional.
> 
> Seems to me like a substantial gain in readability for little or no cost.

If we adopt this convention, should we also have a convention for an
in-out param?  (If so, what?)

-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: Digital signature

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

Reply via email to