On Thu, Dec 4, 2014 at 12:35 PM, Seth Fowler <s...@mozilla.com> 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. > 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. I think that the cost of introducing this convention and dealing with the inconsistency of it being incompletely applied across the codebase for the foreseeable future probably outweighs the benefits. Rob -- oIo otoeololo oyooouo otohoaoto oaonoyooonoeo owohooo oioso oaonogoroyo owoiotoho oao oboroootohoeoro oooro osoiosotoeoro owoiololo oboeo osouobojoeocoto otooo ojouodogomoeonoto.o oAogoaoiono,o oaonoyooonoeo owohooo osoaoyoso otooo oao oboroootohoeoro oooro osoiosotoeoro,o o‘oRoaocoao,o’o oioso oaonosowoeoroaoboloeo otooo otohoeo ocooouoroto.o oAonodo oaonoyooonoeo owohooo osoaoyoso,o o‘oYooouo ofooooolo!o’o owoiololo oboeo oiono odoaonogoeoro ooofo otohoeo ofoioroeo ooofo ohoeololo. _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform