Related articles |
---|
New Book: The School of Niklaus Wirth webmaster@mkp.com (2000-10-31) |
Re: New Book: The School of Niklaus Wirth smoleski@surakware.com (Sebastian Moleski) (2000-11-01) |
Re: New Book: The School of Niklaus Wirth Martin.Ward@durham.ac.uk (2000-11-05) |
Re: New Book: The School of Niklaus Wirth mikael@pobox.com (Mikael Lyngvig) (2000-11-05) |
Re: New Book: The School of Niklaus Wirth arargh@enteract.com (2000-11-07) |
Re: New Book: The School of Niklaus Wirth gkt37@dial.pipex.com (jt) (2000-11-07) |
Re: New Book: The School of Niklaus Wirth vbdis@aol.com (2000-11-09) |
Re: New Book: The School of Niklaus Wirth djg@argus.vki.bke.hu (Gabor DEAK JAHN) (2000-11-11) |
Re: New Book: The School of Niklaus Wirth joachim_d@gmx.de (Joachim Durchholz) (2000-11-11) |
Re: New Book: The School of Niklaus Wirth guerby@acm.org (Laurent Guerby) (2000-11-14) |
[9 later articles] |
From: | "Mikael Lyngvig" <mikael@pobox.com> |
Newsgroups: | comp.compilers |
Date: | 5 Nov 2000 20:47:52 -0500 |
Organization: | Compilers Central |
References: | <200011041324.NAA17379@sml1.martin.home> |
Keywords: | books, design, comment |
> > humans tend to recognize names that differ solely in case without
problems
>
> Humans also recognise abbreviated names, nicknames, names with
> spaces in them...
Yes, and I firmly believe that we will crunch that nut. So far we
haven't managed to do it properly, and yet several languages exist
that do not care (a lot) about white-space. Computer Science is only
like 35 years old - we'll get there eventually. Aliases (abbreviated
names and nicknames) can fairly easily be handled already today.
> > Imagine that your mails, delivered via postal service, starts to
> > bounce because you'd accidentally written "main Street" rather than
> > "Main Street" (or the postal worker thinks you've written "main"
> > rather than "Main")...
>
> (1) The postal service has a lot more to worry about than
> case differences. What if you wrote "Main St."? Would you want
> mail addressed to "Mick Lyngvig" to bounce?
Exactly: Case shouldn't be the issue (and isn't in the real world).
Rather, we should spend our time on simplifying the already complex
communication between developer and maintainer (or sender and
deliverer). It would be very nice if the compiler was able to figure
out that "Integer" was in fact identical to "intger" (or "Mick
Lyngvig" was actually "Mikael Lyngvig").
> (2) A mathematician would be very surprised to find that "n" and "N"
> are treated as the *same* symbol.
That's a really, really bad argument IMHO. If you take a close look
at Mathematics, you'll notice that it is the science of the strange
symbols. I'm confident mathematics would be much easier to
understand, for the average person, if meaningful alphanumeric
identifiers were used rather than obscure symbols developed during the
Dark Ages. When I had Mathematics classes, at the University, I used
to spend more time on trying to memorize the insane symbols than on
the purpose of the equations they described. I suspect quite a few
people, possibly in the neighboorhood of 5.6 billion people, feel
pretty much like me.
> On the other hand, if your compiler is going to be case-sensitive,
> don't do what one compiler did and convert all error messages
> (including identifier names) to UPPER CASE!
Agreed completely. I was actually once the maintainer of a commercial
linker product, which insisted on using ALL UPPER CASE. Pretty
annoying, so I added an option to make it display readable mixed-case
error messages.
Yes, I do find it practical that a programming language enforces
case-sensitivity. However, I see it simply as a poor hack for the
real solution: Instead of reporting "Error: Unknown identifier 'foo'",
the compiler should report "Warning: Reference to 'foo' interpreted as
a reference to 'Foo'" so that the developer would know that he or she
had used a non-standard way of spelling that particular name, like I'd
tell you if you started writing "Hi miKAel", without forcing him or
her to memorize the exact case of all identifiers.
P.S. As far as I am concerned, we don't need to create a major
religious war from this. I've used Pascal for many years and I
certainly don't want to use it professionally, but I still respect
Mr. Wirth a lot and I don't think that the statement "Anybody who
finds it a mistake to have a language ignore case and thus reverts it
from one language to the next is, IMO, not doing excellent work." is
true. To me, that is like saying: I learned something, I am
incompetent.
-- Mikael
[I'll post one or two more on this topic and then it's over, since it's
not really an issue of compiler design -- it's easy enough to make a compiler
do whatever you want with different cases. -John]
Return to the
comp.compilers page.
Search the
comp.compilers archives again.