boolean true and false values.
Tim Rowe
digitig at cix.co.uk
Mon Jun 26 17:10:00 EDT 2000
In article <slrn8lf3q9.us.hat at se-46.wpa.wtb.tue.nl>,
hat at se-46.wpa.wtb.tue.nl (Albert Hofkamp) wrote:
> I understand that now.
> However, I am not quite sure that that is what one wants.
Maybe it isn't; then another language may be more appropriate. When it
/is/ what one wants then Python may be your choice.
Folks don't seem to be able to get away from the notion of a "perfect"
language, ideal for all applications. I don't believe it exists, and if
you "improve" Python for some you may well break it for others. Surely the
competent programmer has a number of languages under his/her belt?
> >Sounds like you're making a case that all newbies should be taught
> haskell or
> >scheme. After all, invariants should be preserved. The best way to
> do that
> >is to make them not vary.
>
> I think I am (is that bad ? :-) ).
No, not at all, IMHO, though I'd suggest adding Eiffel to the list. The
first language I was taught was FORTRAN and would consider INTERCAL to be
an improvement over /that/! I suspect teaching Python to newbies may be a
bit like introducing people to basic woodwork by giving them a router
before they know how to use a saw or chisel!
> In other words, variables are in reality quite tightly connected to
> their
> values because a meaning is given to the variable.
> For example, pointing the variable to a value of another type does not
> fit in
> the idea of invariants. For example, by executing 'total="kjerg"', the
> invariant is not longer true, since "kjerg" is not the sum of elements
> (it is
> not even a number).
But that's /exactly/ right! If you execute 'total="kjerg"' then your
invariant is indeed violated!
> Thus, to a good programmer, the dynamic nature of variables is not
> needed. To
> bad programmers, it is a tool which can be used quite abusively.
As can any tool, of course. The dynamic typing is indeed never /needed/
(probably one of the things Dijkstra proved!), but it's often very /very/
convenient indeed. If it's likely to be a problem to you -- or to the
newbies, use a different language -- but please don't try to take it away
from those of us who want it.
More information about the Python-list
mailing list