[Tutor] Lotka-Volterra Model Simulation Questions

Oscar Benjamin oscar.j.benjamin at gmail.com
Sat Sep 29 15:24:24 CEST 2012


On Sep 29, 2012 11:52 AM, "Steven D'Aprano" <steve at pearwood.info>
wrote:
>
> On 29/09/12 19:16, Alan Gauld wrote:
>>
>> As to using short names to keep things on a single line, there is a huge
>> body of research in Comp Science that shows that meaningful names
outweigh
>> single line expressions every time in terms of reliability,
comprehension,
>> ease of maintenance etc.
>
> If somebody doesn't understand:
>
> p = m*v*(1-(c/v)**2)**-0.5

It should be v/c not c/v. To give some relevance to this otherwise pedantic
post I'll say that I find it much easier to spot the mistake in the line
above than the line below. This is precisely because the line above
resembles the way the equation would normally be written in a book or on
the blackboard etc.

>
> they aren't likely to be much enlightened by:
>
> momentum = rest_mass*velocity*(1-(speed_of_light/velocity)**2)**-0.5
>

Oscar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120929/248d9d2d/attachment.html>


More information about the Tutor mailing list