
On 03/16/2010 07:04 PM, Stewart, Robert wrote:
Andrey Semashev wrote:
On 03/16/2010 02:13 PM, Stewart, Robert wrote:
Steven Watanabe wrote:
Is there a good reason that the same attr can't be both a formatter and a filter?
If not, it would probably make things more readable to have "attr_formatter" and "attr" anyway, though I'd prefer to see "attr" spelled out in each case.
formatters::attr_formatter looks too much for me. And it's attr for shortness. I think it's expansion is obvious enough.
Given code within the formatters namespace, having a using directive in force, or eliminating the "formatters" namespace as suggested elsewhere, the repetition to which you are objecting would be masked or eliminated.
I think, namespaces do better job in categorizing things than name mangling. As noted, namespaces are much more flexible in possible writings.
When one sees "attr" in the documentation or code, it won't be confused with "attr_formatter," which is possible when both are named alike unless they are always namespace scoped.
The docs always state the name qualified. Also, most of the time it's quite obvious from the context, whether it's a formatter or a filter, even if the qualification wasn't there.