[python-win32] Reading constants

Charlie Clark charlie at begeistert.org
Wed Jan 28 09:56:51 CET 2009


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





More information about the python-win32 mailing list