> On 2014-12-04, at 10:51, Nicholas Nethercote <n.netherc...@gmail.com> 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 across the > codebase. I bet we have bazillions of non-const, non-outparams.
ekr’s suggestion is to let the type system provide that indication. The purported value of hungarian notation is that is attaches critical contextual information to the name. That isn’t generally necessary at the call site in a function or class of manageable size. I would personally rather not annotate variables based on provenance altogether, because I don’t find that particularly useful. The other aspect is caller documentation. There is an ambiguity between “I need to play with this” and “I will use this to give you something back”, but as dbaron observes, even this isn’t enough to cover all the available options. Other languages address the documentation concern by using the type system to enforce out- or in-out- ness of an argument, which does have other advantages. Without creating a new - probably largely pointless - template, we don’t really have that option. _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform