Author : Ian Joyner
Page : << Previous 11 Next >>
environment are side effects. Programming in such
an environment requires complex locking mechanisms to ensure that things
happen in the correct order. Locks are rather like waiting for a plane
to take off when it has to wait for another connecting flight. This
cannot be entirely avoided, but should be reduced as much as possible.
For an intermission between sections, I'll mention some interesting
points that the Cambridge Encyclopedia of Language [Crystal 87] makes.
It says that language is an emotional subject. "It is not easy to be
systematic and objective about language study. Popular linguistic
debate regularly deteriorates into invective and polemic. Language
belongs to everyone; so most people feel they have a right to hold an
opinion about it. And when opinions differ, emotions can run high.
Arguments can flare over minor points of usage as over major policies of
linguistic planning and education."
While natural language is difficult to be "systematic and objective
about", should this apply to computer languages? The definition of
natural language is generally beyond our control, with the exception of
languages such as Esperanto. Programming language definition, however,
is within our control. Programming languages must have expressiveness
like natural language, yet be precise and semantically consistent. As
programming languages have rigorous requirements, we should be even more
critical and objective about them. It is a measure of immaturity in the
programming profession that emotional and irrational defensiveness often
denies valid criticism. Many dismiss the choice of programming language
as a religious issue. If language choice is merely religious, then we
might as well still program in assembler, or maybe even binary, because
the adoption of high level languages would have no technical merit.
Language choice, however, is a technical consideration. Technical
measures should judge the effectiveness of a language. Understanding
the role of language helps quantify what must be measured.
The Cambridge encyclopedia lists several functions of language. "To
communicate our ideas", it says is the most common answer, and this must
surely be the most widely recognised function of language. It lists
several other functions of language. One function is emotional
expression. For instance, when we stub our toe, we often emit words,
even when there is no one to hear. Another is social interaction. For
example if someone sneezes, we often "bless" them. Another is the power
of sound, as in poetry and rhyming jingles etc. Another is the control
of reality, as in spells and incantations. Perhaps computer programs
and spells are similar in purpose. Another is recording facts. This
includes record keeping, historical and geographical documents, etc.
Another is the instrument of thought. We often reason about things to
ourselves in language. Another function is the expression of identity.
Language can express who we are, or affirm our belonging to certain
groups. Perhaps the most important role of computer languages is to
enable description, and recording the decisions made during the design
and implementation of a system.
Since language and communication are two closely related concepts, it
is important to understand their relationship, and the nature of
communication. Language is the set of aural and written symbols with
which we communicate. Laurence Wylie in the foreword to "French in
Action" [Capretz 87] describes communication as "To understand this
[communication] we must know the basic meaning of the words common,
communicate, and communication. They are derived from two Indo-European
stems that mean "to bind together." In this ordered universe, no human
being can live in isolation. We must be bound together in order to
participate in an organised effort to accomplish the necessary
activities of existence. This relationship is so vital to us that we
must constantly be reassured of it. We test this connection each time
we have contact with each other."
The concept of binding is also important in computing. In networks,
binding establishes communication links between two or more entities.
This forms a greeting, so that a relationship is established, and
communication is possible. In programming we have the concepts of
static and dynamic binding. Binding in this paradigm makes it possible
for a message to be sent from one object to another, so that they can
communicate and interact. Static binding determines this message in
advance as the receptor is always the same type, or descendant of that
type. Static typing ensures in advance that the receptor object can
process the message. Dynamic binding, means that the exact message to
be sent is determined by the dynamic type of the receptor when the
message is actually sent. For example, on your telephone, you talk to
your friends differently than a client, even though you are using the
same piece of equipment. These are the concepts that C++'s virtual do
not express well. Designing an object-oriented system is like designing
a language by which objects interact. Thus tools used for formal
programming language design, BNF, denotational semantics, and axiomatic
semantics can help in the design of an object-oriented system.
"Language shapes the way we think, and determines what we can think
about." - B.L.Whorf. Bjarne Stroustrup quotes this in "The C++
Programming Language". But is this correct? The encyclopedia says, "It
seems evident that there is the closest relationship between language
and thought: everyday experience suggests that much of our thinking is
facilitated by language. But is there identity between the two? Is it
possible to think without language? Or does language dictate the ways in
which we are able to think? Such matters have exercised generations of
philosophers, psychologists, and linguists, who have uncovered layers of
complexity in these straightforward questions. A simple answer is
certainly not possible; but at least we can be clear about the main
factors which give rise to complications."
The above Whorf quote is a statement of the Sapir-Whorf hypothesis on
language and thought. Edward Sapir (1884-1939) formulated this with his
pupil Benjamin Lee Whorf (1897-1941). It reflects the view of its day
when great value was placed on the diversity of the languages and
cultures of the world. The Sapir-Whorf hypothesis combined two
principles. The first is 'linguistic determinism', which states that
language determines the way we think. The second, 'linguistic
relativity', that the distinctions found in one language are not found
in any other. There can be both verbal and non- verbal thought;
following a road map in a car for example. Street directions are often
difficult to put into words.
The Sapir-Whorf hypothesis in its strongest form, as in the Whorf
quote, is now not generally accepted. For one reason, it is known that
concepts can be translated from one language into another. This is even
if in one language, the concept can be expressed in one word, but takes
a phrase of words in another. A weaker version of the Sapir-Whorf
hypothesis is accepted. That is "language may not determine the way we
think, but it does influence the way we perceive and remember, and it
affects the ease with which we perform mental tasks. Several
experiments have shown that people recall things more easily if the
things correspond to readily available words and phrases. And people
certainly find it easier to make a conceptual distinction if it neatly
corresponds to words available in their language. Some salvation for
the Sapir-Whorf hypothesis can therefore be found in these studies,
which are being carried out within the developing field of
psycholinguistics."
The important question to the programming community is do programming
languages 'shape' the way we think about and design systems? The
negative argument is that it is the concepts behind languages that are
important, not the languages themselves. Languages only provide a
framework for the expression of the concepts. A language can only be as
good as the concepts it implements. A programming language influences
the way we program, and the way we use the concepts it implements. It
can clarify the concepts, or obscure them as in the case of C++. A
language must implement the concepts cleanly and simply. It must
express the concepts in as few words and constructs as possible. But
this does not just mean avoiding keywords as in C. Programmers who
understand the concepts should have no difficulty in adapting to
different languages, as long as the new language implements the concepts
elegantly.
A language can be judged like a wine connoisseur judges wine, by
holding it up to the light to judge for clarity and colour. Ultimately,
it is the taste that matters, but good colour and clarity suggests that
the taste is more likely to be good. Clear programming language
definition helps in the goal of the production of quality software.
So where does this leave Sapir-Whorf with respect to programming
languages? Programming languages do not shape the way we think. It is
the concepts that shape the languages, and it is the way we think that
shapes the concepts. Those who have attempted to learn a language in
order to learn object-oriented programming realise that it is the
concepts which must be grasped in order to be effective. Once the
concepts have been learnt, object-oriented programming seems a natural
way
Page : << Previous 11 Next >>