<p><br>
On Sep 29, 2012 9:41 AM, "Oscar Benjamin" <<a href="mailto:oscar.j.benjamin@gmail.com">oscar.j.benjamin@gmail.com</a>> wrote:<br>
><br>
><br>
> On Sep 29, 2012 2:25 AM, "Alan Gauld" <<a href="mailto:alan.gauld@btinternet.com">alan.gauld@btinternet.com</a>> wrote:<br>
> ><br>
> > On 28/09/12 21:32, Jim Apto wrote:<br>
> ><br>
> >> I'm relatively new to python, and was asked to program a lotka-volterra<br>
> >> model (predator and prey relation) simulator.<br>
> ><br>
> ><br>
> > No idea what that means in practice but commenting purely on the code provided...<br>
> ><br>
> ><br>
> >> x represents prey population<br>
> >> y represents predator population<br>
> ><br>
> ><br>
> > so use names that say so, like preyPop and predatorPop<br>
> > Its only a few extra letters typing but makes things much more readable.<br>
><br>
> As a mathematician I'd have to disagree with you there Alan. This model already has an established notation:<br>
> <a href="http://en.m.wikipedia.org/wiki/Lotka%E2%80%93Volterra_equation">http://en.m.wikipedia.org/wiki/Lotka%E2%80%93Volterra_equation</a></p>
<p>Accidentally sent that prematurely.</p>
<p>I meant to say that changing the notation will only lead to confusion.</p>
<p>Also there are good reasons for using short names in equations. It makes it much easier to see the whole equation at once, which makes it easier to understand the equations and easier to check your code. If you make the variable names too long, even simple equations like these will have to split over several lines and be more difficult to read/check.</p>

<p>Oscar</p>