Professional Documents
Culture Documents
programming language
We've met here to show you what the C++ language is and what we use it for.
Now once we have installed the programming environment allowing us to write, run
and compile C/C++ programs (chapter 0 of this course), let us consider for a
moment, what language itself is, not only C++, but any language people use. We
will try not to resort to scientifically sounding definitions and speaking informally, we
can say that a language is a tool for expressing and recording human thoughts. In
other words, it's a mechanism known to us and to our partners, allowing us all to
understand and to be understood. We can use our language for speaking, writing,
reading, listening, thinking and many others purposes.
At least one language accompanies us throughout our whole lives - it's our native
language, our mother tongue, which we learn almost unconsciously at the very
beginning of our programming career. We will learn other languages, mostly as a
result of a conscious decision, forced by social conditions or business needs. Such
languages, which we use to communicate with other people, are called natural
languages. They were created over the centuries and still are subject to change. If
we ignore languages that have been created artificially, such as Esperanto or even
Quenya (the language used by elves in Tolkien's world), their development is almost
independent and takes place naturally, in a way that gives us little or even no
control over it.
However, there are languages whose creation and development were and continue
to be dictated by the specific needs while the development is fully subject to control
by very wide groups of people, like international committees and work groups. The
shape of these languages is defined by international standards and although they
are understood by many people, the exchange of thoughts between human-beings
is not their most important application.
Such languages are, among others, programming languages. You are probably
familiar with this concept already. A programming language is defined by a set of
certain rigid rules, much more inflexible than any natural language. For example,
these rules determine which symbols (letters, digits, punctuation marks, and so on)
could be used in the language. This part of the definition of the language is called
lexicon. Another set of rules determines the appropriate ways of collating the
symbols - this is the syntax of the language. We would like to be able to recognize
the meaning of every statement expressed in the given language and this is what
we call semantics. Any program written by us must be correct in these three ways:
lexically, syntactically and semantically. Otherwise, it will neither run nor produce
acceptable results. You can be sure that you will experience all of the described
errors, as to err is human and these humans write computer programs.
The expressive power of programming languages is much, much weaker than those
offered by natural languages. We will not be able (although we can try) to use such
a language to express human emotions and it is hard to imagine a declaration of