Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
пособие(2).doc
Скачиваний:
133
Добавлен:
14.03.2016
Размер:
3.31 Mб
Скачать

Text 1. Programming languages

a) __________ Some, but not all, authors restrict the term "programming language" to those languages that can express all possible algorithms. 

b) __________ However, the usage of both terms varies among authors, including the exact scope of each. One usage describes programming languages as a subset of computer languages. In this vein, languages used in computing that have a different goal than expressing computer programs are generically designated computer languages. For instance, markup languages are sometimes referred to as computer languages to emphasize that they are not meant to be used for programming. Another usage regards programming languages as theoretical constructs for programming abstract machines, and computer languages as the subset there of that runs on physical computers, which have finite hardware resources. Itis emphasized thatformal specificationlanguages are just as much programming languages as are the languages intended for execution.

c) __________ Each languagehas a unique set ofkeywords(words that it understands) and a specialsyntaxfor organizingprograminstructions. High-level programming languages, while simple compared to human languages, are more complex than the languages the computer actually understands, called machine languages. Machine languages are the only languages understood by computers. While easily understood by computers, machine languages are almost impossible for humans to use because they consist entirely of numbers. Programmers, therefore, use either a high-level programming language or an assembly language. An assembly language contains the same instructions as a machine language, but the instructions and variables have names instead of being just numbers. Programs written in high-level languages are translated into assembly language or machine language by a compiler. Assembly language programs are translated into machine language by a program called an assembler. Each type of CPU has its own machine language and assembly language, so an assembly language program written for one type of CPU won't run on another.

d) __________ Now, most programs are written in a high-level language such as FORTRAN or C. Programmers still use assembly language when speed is essential or when they need to perform an operation that isn't possible in a high-level language. A programming language such as C, FORTRAN, or Pascal that enables a programmer to write programs that are more or less independent of a particular type of computer. Such languages are considered high-level because they are closer to human languages and further from machine languages. In contrast, assembly languages are considered low-level because they are very close to machine languages. The main advantage of high-level languages over low-level languages is that they are easier to read, write, and maintain. Ultimately, programs written in a high-level language must be translated into machine language by a compiler or interpreter. The first high-level programming languages were designed in the 1950s. Now there are dozens of different languages, including Algol, BASIC, COBOL, C, C++, FORTRAN, Pascal, and Prolog.

e) __________ 4GLs are far removed from machine languages and represent the class of computer languages closest to human languages. Often abbreviated 4GL, fourth-generation languages are programming languagescloser to humanlanguagesthan typicalhigh-level programming languages. Most4GLsare used toaccessdatabases. For example, a typical 4GLcommandis FIND ALL RECORDS WHERE NAME IS "SMITH" The other four generations ofcomputerlanguages are:first generation: machine language;second generation: assembly language;third generation: high-level programming languages, such as C,C++;fourth generation: languages used for artificial intelligenceandneural networks. Regardless of what language you use, you eventually need toconvertyour program into machine language so that the computer can understand it. There are two ways to do this: 1)compilethe program; 2)interpret the program. The question of which language is best is one that consumes a lot of time and energy among computer professionals. Every language has its strengths and weaknesses. For example, FORTRAN is a particularly good language for processing numerical data, but it does not lend itself very well to organizing large programs. Pascal is very good for writing well-structured and readable programs, but it is not as flexible as the C programming language. C++ embodies powerfulobject-orientedfeatures, but it is complex and difficult to learn. The choice of which language to use depends on the type of computer the program is to run on, what sort of program it is, and the expertise of the programmer.