Re: "no variable or argument declarations are necessary."



"Michael" <ms@xxxxxxxxxxxx> wrote:

> James A. Donald wrote:
> > On Sun, 02 Oct 2005 17:11:13 -0400, Jean-Francois Doyon
> > James A. Donald:
> >> > Surely that means that if I misspell a variable name, my program will
> >> > mysteriously fail to work with no error message.
> >> No, the error message will be pretty clear actually :)
> > Now why, I wonder, does this loop never end :-)
> > egold = 0
> > while egold < 10:
> > ego1d = egold+1
>
> I know (hope! :-) that's a tongue-in-cheek question, however the answer as
> to why that's not a problem is more to do with development habits rather
> than language enforcement. (yes with bad habits that can and will happen)
>
> [snipped description of test-driven development culture]

As an aside, more to the point of the specific erroneous example is the lack of the standard python
idiom for iteration:

for egold in xrange(10):
pass

Learning and using standard idioms is an essential part of learning a language; python is no
exception to this.

George


.



Relevant Pages

  • Re: The downsides of pseudo-historical fiction
    ... James A. Donald: ... conspicuous counter stereotypical virtue, and no ... thug who smacked her around. ...
    (rec.arts.sf.composition)
  • Re: WorldCon 2006
    ... James A. Donald: ... "Keith F. Lynch" ...
    (rec.arts.sf.fandom)
  • Re: Bush Strums as New Orleans drowns
    ... >James A. Donald: ... I have essentially zero interest in finding out. ... is not a fascist dictator, I don't see any useful purpose being served ...
    (rec.arts.sf.fandom)
  • Re: Need help with expanding energy dome
    ... James A. Donald wrote: ... Devices like remote cameras can tell us what is or is not happening. ... And if you still wish to argue that there are areas in which incidents ...
    (rec.arts.sf.composition)
  • Re: Kresss Probability Trilogy Qs
    ... James A. Donald: ... David Mitchell ... heuristics for dealing with the combinatorial explosion ...
    (rec.arts.sf.science)