|
Boost Users : |
From: Markus Werle (yg-boost-users_at_[hidden])
Date: 2003-02-28 06:55:10
William E. Kempf wrote:
>
> Markus Werle said:
>> [...]
>> A hard burden You lay on developers.
>
> It's not a burden.
Well, it depends: once You _have_ a library written
in the other style and once You have tested it
(maybe certified it) and started to let other programs
depend on it, a style change might be at least very annoying,
because names from the lib appear in the user's code.
If the dependency tree is large, that _is_ a burden.
>> So maybe the code has to be piped through a
>> code de-beautifier when it comes to a boostification.
>
> That's a bit harsh.
It was not meant to be harsh. Maybe throwing in my
opinion about what is beauty was a bad idea, so
if You have a shell prompt at hand:
# cat mypost | sed -e s/de-beautifier/converter/g
> If *you* don't care for the style,
I care. That's the reason for the OP.
> you're welcome to that opinion, but voicing it in this manner
> isn't going to help anyone to agree with you.
I am not on a jihad for some code style, but rather
on an investigation tour how much it takes to
boostify existing code. I just sometimes cannot hold back
my comments on things I dislike to be as they are.
Please assume from now on that I do not want to try to change
the boost rules (I give up before trying) but rather find
a convenient way to obey them without sacrificing too much.
>> IMHO (UsingThisConventionHere == CommonPracticeElsewhere)
>
> It's not common practice everywhere
No contradiction here. Unfortunately it is common pratice
for some very famous C++ books like Herb's, Nicolai's, Andrei's and
David V.'s books. That is why I talked about a heavy burden. At least
David V.'s book will be without concurrence for a long time, so
expect some programmers to GetUsedToThatStyleBeforeTheyCommitCodeToBoost.
> But the important thing is that the whole
> point of Boost is to be a test bed and development area for libraries that
> *might* be considered for inclusion in the standard. As such, we have to
> follow the standard naming conventions.
Or change _them_? <- yes, it's a joke!!!
Seriously:
This argument is strong enough to stop the discussion about styles
immediately, therefore let us find satisfying solutions for the
follwing case:
If some guy has written code that he thinks is good enough
to expose it to a boost review and the only problem he sees with his lib
is the completely different naming convention. What do You propose him
to do?
I see several possibilities:
1. The standard rules, AFAICS, are meant for the _user_ interface
(I guess this from the bogus names some vendors use to make their
internal code completly unreadable)
So would it be acceptable if some boost::lib is rule-compliant
in the interface and for the "public" namespaces, while retaining
the other style in the brain-damaging internals, where some
programmers might need them to understand their own code?
Minimalist's approach: only _add_ aliases for
the user interface that follow the convention:
namespace conformant_garbage_c = GarbageC;
... template typedefs at hand, soon ...
2. Another possibility - which is cleaner and maybe to prefer -
would be the automatic code conversion.
If You have a convenient tool for that, I would like to test
it on some code (e.g. Loki, Daixtrose) to see the effects.
The sed approach from above may help, but I could not yet extract
from the docs how to apply regexes such that MyOldStyle becomes
my_old_style.
I think this could be a 5-liner with boost::regex.
I haven't used that lib until today, so I say ThankYou (thank_you)
for any code snippet which may serve as a starting point.
best regards,
Markus
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net