I had a thought ... (I know, call the newspapers).

Laura Creighton lac at cd.chalmers.se
Thu May 31 09:36:11 EDT 2001


Lets give python a new type.  We will call it money.  And we will
tell people to use that.  And under float, we will suggest strongly
that people are most likely to want to use the type money rather
than float.  And we will document the behaviour of float.
And we will strongly suggest that people who do not know what to use, use
money.  Indeed we can say that `floating point is servere black
magic used by people who really know exactly how to deal with
the sort of errors caused by 1.999999996 not really being 2.0.
If this does not sound like you, do not use floating point.'
And we can use the ¤ (This is a Euro sign for those of you using
the wrong font.)  This will show off that we have Unicode, which 
is cool and remind the Americans that there are non-Americans on
this planet, which is cool for another reason.  And all of us that
use real floats will not have to do a thing.

In 20 years I have had 0 luck teaching people to not use floating
point for money.  The fools carefully ignored me and went back to
their old vile ways most of the time.  They can't tell the
difference between floating point and fixed and they don't listen
when you tell them and they don't remember what you said at
lunch time.  the good ones ask `which was the fixed point, again?'
and the bad ones just say `fixed?  floating? No I am sure you
never mentioned those words this morning.'  I wanted the default to
change because I did not think that it was ever possible to 
teach most people about floating point because `nothing' is
precisely how much they want to know about it with a near religious
furvor.  I wanted the default behaviour to change so that these
people can't screw up their lives, my life, everybody's life too
much.

**********BUT***********
I am almost convinced that I can teach them to use the type money,
a slower, more accurate type that accurately represents money and 
other valuable things that must not have floating point error in them.
I'd like to run some tests first, and drat, the students are all
writing exams or on vacation so I don't have a handy supply of
victims.

Is this a good idea?  Or I am just deleriously happy because my
friend Anders Hammarquist, the person who told us to use python
and who has been using it since 1.4 has stopped being a full time
physics grad student who can't come over to my house for dinner let
alone write code with me and has gone back to being another founder
of this company?  Wow how the code gets fixed now, and he knows all
the current coolest tricks in physics too.   I'm happy enough to be 
crazy for sure.  But is the idea any good?

Laura




More information about the Python-list mailing list