Stephen McInerney wrote:
> Hi Alan,
> 
>>> My friend clarifies: "It's not the efficiency of doxygen that's the
>>> question. The problem is that you can add fields to objects as you go in
>>> Python so you need to do a deep analysis of the code to determine the 
>> class
>>> structure which you don't have to do with C++ (or Java)."
>> That's true it's one of the "benefits" of a dynamic language, but it does
>> make the code harder to parse.
> 
> Is this not just evidence of a very bad Python coding style?
> Should we not always declare *all* class fields in the class definition
> by assigning to them, even if the assignment is token or dummy
> i.e. 'None', "", [], {} etc.

Not necessarily. Python *is* highly dynamic. It's not just limited to 
simple data attributes. Base classes can be determined at runtime, 
methods can be added to classes or redefined, metaclasses can do all 
kinds of magic, etc etc.

> Can you cite us a literature source for saying that Python is 3-4x more
> expressive  per line-of-code than C++?
> Would come in handy for evangelizing.

See http://wiki.python.org/moin/LanguageComparisons
The Prechelt paper is a research paper. Some of the other links provide 
examples where you can draw your own conclusions.

I have done a few comparisons of Python with Java here:
http://personalpages.tds.net/~kent37/stories/00017.html

Kent
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to