[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: another take on hackers and painters




Dan Sugalski <dan@sidhe.org> wrote:
 >At 3:25 PM -0500 5/21/03, mcguire@cs.utexas.edu wrote:
 >>What about 1 + "three"?  :-)
 >
 >I'd generally not consider that a number, for two reasons:
 >
 >1) There are all sorts of localization issues--"three" doesn't mean 
 >much in Taipei.

That's what the locale stuff is for.[1]

 >2) If the parser saw 1 + three in the code stream it wouldn't do the 
 >math, so I'd generally assume that 1 + "three" wouldn't either.

Digit bigot.  :-)

 >I wouldn't be surprised to find a language that allowed "three" either
 >as a string constant or bareword to translate to the number three.

I wouldn't be surprised either, but I do seriously doubt it would be
useful.  Baroque and entertaining, maybe.

 >Still, it's all points in an n-dimensional continuum. Different tools 
 >for different jobs, and all that.

I guess the next questions are, "where does each language draw its
line?" "does it consciously draw a coherent line?"[2] and "are there
sweet spots in the continuum?"

Returning to the subject of the list, I'd have to guess that the answer
to the second one is, "it ought to," simply to reduce the amount of
trivia you have to remember in order to use the language.

And going back to the subject of the thread, I would guess the answer to
the third to be:

1. One way over on the strong static typing, bondage and discipline,
"don't do anything I don't explicitly tell you to" side (for those of us
who are so lazy as to want someone else to do our thinking).

2. One in the strong dynamic typing but no implicit coercion area (for
those of us who want eval and friends but can't understand that 1 * "2"
* "three" really should be 0).

3. One somewhere over somewhere very close to the DWIM, "here's my
bits and where I want to use them; you figure out how it's going to
work" patch (for those of us that need to get something working between
the time the boss rounds the corner and the time the boss gets to our
desks).

Or maybe I don't know what I'm talking about and should really just cut
down on the medications.

(Hm.  My language is intuitive.  Your language does weird things.  His
is a DWIM language.)

Tommy McGuire

[1] Yeah, I'm going to have a hard time getting to sleep after that one.

[2] I'm going to have to say that I just discovered that I think Perl
(the only language I know right offhand that does this sort of thing) is
odd in this respect:

$ perl -e 'print 1 + +3, "\n";'
4
$ perl -e 'print 1 + + 3, "\n";'
4
$ perl -e 'print 1 + "+3", "\n";'
4
$ perl -e 'print 1 + "+ 3", "\n";'
1