newbie: self.member syntax seems /really/ annoying

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Thu Sep 13 21:39:34 CEST 2007


Wildemar Wildenburger a écrit :
> Bjoern Schliessmann wrote:
> 
>>> No, but the point being made is that it would be better IN
>>> THIS CASE.
>>
>>
>> It wouldn't. IMHO, rewriting the code to two or three lines would be
>> better.
>>
> 
> Well I think Charles' Point about making the equations look like the 
> ones in the paper(s) is a pretty good one. That is a special case in 
> that the code becomes clearer when it conformes to the standards of the 
> domain it is referring to; it is not meant to be understood by itself 
> but rather in conjunction with documents that motivate it.
> 
> Or in short: Breaking it into n>1 lines would make it more readable but 
> would break the connection with the form given in the papers. (Yes, of 
> course you can refer to the eq. in a comment but believe me: if you're 
> used to seeing a certain (form of) equation, your mind will trip over 
> any variation. That is best avoided.)

OTHO, simple math-illeterate programmers like me will have hard time 
maintaining such a code. Also and FWIW, it's not always possible to make 
a direct translation of a mathematic formula|algorithm in Python, and 
even when it is, it's not always the best thing to do wrt/ perfs (I 
recently had such a case, and after a pythonic rewrite the code was 
about 75% shorter, 50% faster, and 200% more readable for average joe 
programmer).

> ... my 2 sents, anyway ...

May I add my 2 cents - or should I send them  ?-)




More information about the Python-list mailing list