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

Human languages (was Re: expressions vs. statements)



On Wed, Dec 19, 2001 at 03:31:30PM -0000, Seth Gordon wrote:
> Every natural human language makes some kind of grammatical
> distinction between nouns and verbs. 
One point to consider: Most (if not all) human languages also have devices to
turn nouns into verbs and vice versa. E.g. appending -ment to some verbs makes a
noun of them, other rules  change nouns into verbs like in german Fenster
(window) - fensterln (this is from the bavarian dialect, meaning to climb up to
the window and chat with the inhabitant).
So either you could conclude, that programming languages also should have
features like this or that human languages do not lend themselves as models for
programming languages.
> I think programming languages
> should take note of this distinction, and make a clear boundary
> between forms that have side-effects (verbs) and forms that do not
> (nouns).  The real reason, IMHO, that so many programmers get tripped
> up by bugs like "if (a = 0) {...}" is that they have trouble
> interpreting a form that is simultaneously a noun and a verb.
I don't think that this is the case.
The meaning of parts of human language utterances depend usually on
their context. (My linguistic vocabulary is rather rusty, so excuse any
blunders) In languages with subject-verb-object sentence structures the
distinction between subject and object is made on the position in the
sentence (at least in languages like English, other languages put some
affixes on the words and have no prescribed order). So the difference,
if "a = 0" is a bug or not depends on the position in the utterance: "if
(a=0) {..}" is an error, "if (b) {a=0}" probably not. This is something
humans do a lot in speech understanding, so they are rather skilled in
solving these problems.
Cheerio,
-- 
J.Wender@science-computing.de  -  Fon +4970719457-257 Fax-211
science+computing ag - Hagellocher Weg 71-75 - 72070 Tübingen
This is Linux Country. In a quiet night you can hear Windows boot.