[Tutor] Lotka-Volterra Model Simulation Questions

Wayne Werner wayne at waynewerner.com
Sat Sep 29 16:08:51 CEST 2012

On Sat, 29 Sep 2012, Oscar Benjamin wrote:
> On Sep 29, 2012 2:25 AM, "Alan Gauld" <alan.gauld at btinternet.com> wrote:
> >
> > On 28/09/12 21:32, Jim Apto wrote:
> >
> >> I'm relatively new to python, and was asked to program a lotka-volterra
> >> model (predator and prey relation) simulator.
> >
> >
> >> x represents prey population
> >> y represents predator population
> >
> >
> > so use names that say so, like preyPop and predatorPop
> > Its only a few extra letters typing but makes things much more readable.
> As a mathematician I'd have to disagree with you there Alan. This model
> already has an established notation:

Regardless of established notation, unless only mathematicians will be reading
the code, and only those intimately familiar with the equation, it makes much
more sense to use meaningful names. Because that way, when sending the code to
a mailing list full of non-mathematician programmers, they'll know exactly what
the variables are supposed to be for, so they wont have to look anything up on
wikipedia. After all, they've got a finite amount of volunteer time, and would
you prefer to get more advice about logic errors, or the guarenteed responses
about variable names?

I for one, prefer to get the most value from my question as possible. It shows
respect to the people I'm asking, and to everything else that they could
possibly be spending their time on, including answering other questions.


More information about the Tutor mailing list