PEP0238 lament
mcherm at destiny.com
mcherm at destiny.com
Mon Jul 23 18:05:34 EDT 2001
Steve Horn replied with a few comments, let me try to
address some of his points:
Your second point, was to attack my claim:
> just imitating C isn't very convincing
> since other languages (eg: Pascal) use other syntax
Which you do by listing, and rating, languages (I'm
paraphrasing you here quite severely, and probably
missing a few good points along the way):
> 1/2 == 0.5:
> Perl -- untyped, thus irrelevent
> LISP -- academic language only
> Pascal -- the Ada folks thought it was wrong
> Modula 2+ -- Minority languages
> JavaScript -- dumbed down language
> 1/2 == 0:
> Visual BASIC -- most used language 3 yrs running
> C -- what need I say?
> C++ -- ditto
> Java -- ditto
> Ada -- intentionally changed the Pascal practice
> VBA -- most used non-programmer language
Now, I *could* argue with you. I could say that VB, C++,
and Java are just imitating C, and thus you only have 2
independent examples of making this choice (C and Ada).
I could say that mere put-downs of excellent languages
like LISP and Modula 3 (and other languages, like JavaScript)
are hardly an "argument". But instead I'm going to go
ahead and concede... as you've demonstrated with this list,
consistancy with "the C family" *is* a desirable trait.
This doesn't make it good language design, but it's clearly
an argument in favor of 1/2==0.
----
Your first point, though, was:
> [F]loat division is simply a logical extension of int division,
> the same as float addition compared with int addition. The fact
> that some people *see* them as different things is irrelevant
> given that others don't.
On this point I'm holding my ground. I do NOT belive that
int division is "the same thing" (with different domain). For
instance a VERY IMPORTANT feature of "division" is that
(A / B) * B == A, and "integer division" doesn't maintain
this. Another clear way to tell that "integer division" is
different from "division", is to see that they give different
answers... 25 <int division> 3 == 8, while
25.0 <mathematical division> 3.0 == 8 1/3 =~= 8.3333333333333339
However, these are minor points. My impression is that you
agree with my major points:
> > [Both] are USEFUL things, and a good language should allow
> > BOTH.
> Here I agree - division that implicitly coerces integers to
> floats is likely to be useful, at least for some.
And secondly that the issue here is to balance issues of code
breakage (VERY BAD THING) against language design (VERY
DESIRABLE (but also debatable) THING). Good luck Guido!
-- Michael Chermside
More information about the Python-list
mailing list