next up previous
Next: Java vs.English Up: Introduction Previous: Computers and Programs

The Idea of Language

How do we give instructions to a computer? Well, we can type them in. But life isn't quite so easy as that because the computer must have the instructions expressed in its own language. So what we need to do is to learn the computer's language, right? At one time that's exactly what people did; these days people do this only in very special circumstances. The reason is that

  1. the language of the computer uses symbols that we don't ordinarily use
  2. the computer's language is so simple that it would take hours of programming just to get it to add two numbers

Why don't we use a natural language such as English or French or Mandarin to give instructions to the computer? Wouldn't this be a lot easier since we already know the language?

It turns out that the computer, because it is what it is, (a machine that reads from and writes to memory and follows the instructions that we give it) has a lot of difficulty deciding whether certain sentences in our natural language are grammatically correct or not! When I say 'has a lot of difficulty' this means that the computer would have to process a very large number of instructions in order to determine whether such a sentence is in the grammar or not, roughly speaking. The fact that we can show that certain problems require the computer to process at least a certain number of instructions to solve them is quite amazing, and if you go on in computer science to take some theory courses, you'll find out more about this and many other amazing things.

In addition to the inherent complexity of natural languages, there are problems such as non-standardization of language constructs amongst speakers of the language, inherent ambiguity in grammar, and so on.

Of course what this means is that we don't want to use our natural language to give instructions to the computer because our natural language is so complex. If the computer's language is too simple to do complicated things and our natural language is too complex for the computer to easily deal with, what do we do?

What we do is to use an invented language, and write a program called a compiler which translates between the invented language and the language of the computer. The language will be complex enough so that we can instruct the computer to do many things without spending hours programming, but simple enough that the computer can convert it into its own language by processing a 'reasonable' number of instructions.

In our case we'll be using a language called Java. There are many languages that we could have chosen to use (C, C++, Perl, Fortran, Pascal, $\dots$), and each one was developed in order to make giving instructions to the computer easy. There are many such 'high-level languages' because there are many people with different ideas about what is 'easy' and what is 'better', as well as different programming tasks which may be more suitable to one language than another. At any rate, a 'good' language should make it easy for the programmer to tell the computer what to do, roughly speaking.


next up previous
Next: Java vs.English Up: Introduction Previous: Computers and Programs
Chris Trendall
Copyright ©Chris Trendall, 2001. All rights reserved.

2001-12-09