[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: another take on hackers and painters
On Wednesday, May 21, 2003, at 03:02 PM, Dan Sugalski wrote:
> Erm, this argument, boiled down, turns into "people make logic errors
> when writing perl, therefore perl makes people make logic errors".
> Sure, perl's autoconversion can bite you, but so can checking objects
> capabilities at runtime by looking for methods by name, containers
> that are strictly typed, or the assumption that all strings are a
> sequence of non-zero 8-bit characters with a null terminator.
> It may well be something that you, personally, aren't comfortable
> with. That's fine. It's certainly something that people do, on
> occasion, mess up, and that's fine too. (I sometimes swap < and >, but
> that's not an argument for eliminating one or the other) It's a
> language behaviour that is, in some circumstances, very useful, just
> like almost any other language behaviour. Any feature may render a
> language sub-optimal for some use or other, but no language is
> universally appropriate.
I think you're being mushy. The key difference between something like
string->number conversion and the confusion between '<' and '>' is that
there's no obvious way for the evaluator to check whether you meant <
or >, whereas there is a very easy way to stave off the confusion of
adding a string and a number; a way which nonetheless provides the
programmer with an easy out should he wish to make such a conversion.
Put another way: don't you want as much checking as you can possibly
get at acceptable cost?
isn't having to write 'string->number' an acceptable cost?