declaration of variables?

Jp Calderone exarkun at intarweb.us
Sun Feb 16 14:29:04 EST 2003


On Sun, Feb 16, 2003 at 02:35:53PM +0100, Andr? Jonsson wrote:
> Carl Banks wrote:
> >I guess it depends on the person, but that's certainly true of me.  In
> >fact, I get more errors when declarations are required; not because I
> >misspell the variables, but because I forget the damn declarations.
> 
> That may be the case, but it's better/easier if the error/warning occurrs 
> when the program i compiled (run-time or otherwise) 

  No.  You think it is better or easier.  Many other people disagree.

  A good set of unit tests will catch this error any time it comes up. A
good set of unit tests will also catch many *other* errors that variable
declaration won't.  If you don't have good unit tests, it might be time to
consider writing some.

  As a Python programmer of 5 years, I can give my personal experience:
typos in names haven't cost me anything more than a dozen lost seconds once
every few weeks.  On the other hand, having to type declarations for every
variable I use would cost me at least a hundred times more time, on a
regular basis.


> than when the program execution gets to the spcific error, in which case
> it may, or may not, be detectable.

  I don't understand what this even means.  If the error isn't *detectable*,
it obviously isn't even an error.

  If it *is* an error, then you can write a unit test that will catch it.

  Jp

-- 
 up 8 days, 0:28, 3 users, load average: 0.04, 0.04, 0.00
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20030216/960f22b7/attachment.sig>


More information about the Python-list mailing list