I typically append "Out" to these parameter names.  The o prefix would be more 
concise.  +1

Thanks!

Ben

----- Original Message -----
From: "Seth Fowler" <s...@mozilla.com>
To: "dev-platform" <dev-platform@lists.mozilla.org>
Sent: Thursday, December 4, 2014 1:35:06 PM
Subject: Proposal: Change the coding style guide to allow an 'o' prefix to      
indicate out-params

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.

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

Reply via email to