[Tutor] Efficiency of Doxygen on Python vs C++?

Stephen McInerney spmcinerney at hotmail.com
Sat Aug 18 11:38:51 CEST 2007


Kent,

>>I was asking if it's a recognized good programming practice to
>>declare and initialize *all* members in the class defn.
>
>What do you mean by "initialize *all* members in the class defn"?
- obviously I meant to say do it in the __init__() method,
I wrote the snippet as I was rushing out the door to an exam,
but I think the intent was clear.

>If you mean to initialize the variables in the __init__() method:
>maybe this is more common but I don't think I have ever seen it recommended 
>to initialize all variables in the __init__() method. Certainly there are 
>times when it makes sense to have some of the initialization in other 
>methods that are called from __init__().

I only said "make a token dummy assignment in __init__() to hint
to the static analyzer the name and expected type, I didn't say
"you must do all the actual initialization itself in __init__()".

In the context of the original question
"where and how should we assign class members in order
to flag member names and types to static analyzers like
Doxygen or pylint?"
I understood that people were agreeing
"Yes, assigning each member token values in the __init__()
method is a good practice".

> > I think I'm hearing a general yes on that - any other opinions?
>Not sure where you think you are hearing a yes, I am hearing a lot of 
>objections.

No they didn't - they said that this cannot be done for true dynamic code,
which is true, but obviously doesn't apply to working with
static analysis tools, which is what the question was about.

Regards,
Stephen

_________________________________________________________________
Messenger Café — open for fun 24/7. Hot games, cool activities served daily. 
Visit now. http://cafemessenger.com?ocid=TXT_TAGHM_AugHMtagline



More information about the Tutor mailing list