Am 27.01.2009 um 18:36 schrieb Vernon Cole:

Charlie:
 In my experience, which goes back 35 years, constants like this are
pretty much what the word implies -- constant.  They are used to
communicate between two software packages which were made by different
people on different machines using different languages. If the value
of the "magic number" where to change, both parties would have to
rewrite their interface code.

Therefore, in practice, these codes once defined will never change, so
you should not have any trouble if you just hard code the number into
your program.

It is a good practice to define it as a named object for documentation
purposes, so the next guy who reads your program (or yourself five
years later) can understand what the number means in the interface.


Thanks very much for the advice, Vernon.

Charlie
--
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226



_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to