steve at lurking.demon.co.uk
Fri Jul 27 04:55:53 EDT 2001
On Wed, 25 Jul 2001 16:07:19 -0700, Paul Prescod
<paulp at ActiveState.com> wrote:
>Stephen Horne wrote:
>> On Mon, 23 Jul 2001 17:23:18 -0700, Paul Prescod
>> <paulp at ActiveState.com> wrote:
>> >It is very common to pass floats to functions that expect integers and
>> >vice versa without really thinking about it. It is *especially* common
>> >to pass integers to functions that expect floats.
>> And in my mind this is the problem, not division. The traditional
>> solutions to the problem of bad inputs are called *validation* and
>So rather than fix the language to reduce mistakes we should impose more
>discipline on programmers. That sounds like a C or Perl solution, not a
I've never heard of validation dismissed like this before. It is a
basic and fundamental programming principle - not just something to do
if you feel like it, and not something that depends on language choice
in any way except in how you achieve it.
A program or library which accepts bad inputs without generating an
error or at least documenting the limitation is bad, irrespective of
what language you are using.
You don't think you should have to worry about datatypes.
You don't think you should have to worry about validation.
Is there a pattern here? - Perhaps you shouldn't be worrying about
programming at all?
More information about the Python-list