[C++-sig] Inheritance question
seefeld at sympatico.ca
Mon Feb 13 06:44:01 CET 2006
Roman Yakovenko wrote:
> On 2/12/06, Stefan Seefeld <seefeld at sympatico.ca> wrote:
>>Roman Yakovenko wrote:
>>>On 2/10/06, Koen Van Herck <koen_van_herck at yahoo.com> wrote:
>>>>OK, it works now, if I expose User, BaseWrap and Derived and use
>>>>I was commenting out too much code to make the example smaller :(
>>>Hi. If you are new to boost.python then try to use one of the
>>>available code generators.
>>>Pyste or pyplusplus. You will be able to learn a lot from code
>>>generated by them.
>>I disagree. I find it generally much more instructive to either
>>read documentation explaining the semantics of the various artifacts
>>involved, or actually study the code that I'm about to use.
>>Code generators are nice and convenient, but they rarely make
>>things more transparent.
> They don't. I agree with you, but code generators contains a lot of knowledge.
> Not using it it is a waste. For example: the case in this post is very simple.
> Pyste or pyplusplus know what code should be generated to this case.
> May be I did not express my self: code generators is very valuable resource
> for beginners, using them they can help them self in few minutes.
> Many times it takes few hours to get the answer, even to the simple
> question, right?
> So, why not?
We seem to be in basic agreement. Depending on what the user's goal is, he
may not care much about how the code looks like as long as it does what the
user wants. I was assuming a user who wants to understand how it works, i.e.
the bpl idioms themselves (in this particular case).
Suggesting to use a tool to generate code in language X by using language
Y makes indeed a lot of sense if Y reflects the vocabulary of the user
(i.e. the 'problem domain') better than X.
More information about the Cplusplus-sig