Unit 10 Program Design
Text 1 Computer Languages
Computer languages have undergone dramatic evolution since the first electronic computers were built. Early on, programmers worked with the most primitive computer instructions—machine language. These instructions were represented by long strings of ones and zeroes. Soon, assembly language was invented. It maps machine instructions to human-readable mnemonics, such as ADD and MOV.
In time, higher-level languages evolved, such as PASCAL, BASIC, COBOL, C, C++, and JA V A. These languages let people work with something approximating words and sentences, such as Let I = 100. These instructions were translated back into machine language by interpreters and compilers. An interpreter translates a program as it reads it, turning the program instructions, or code, directly into actions. A compiler translates the code into an intermediary form. This step is called compiling, and produces an object file. The compiler then invokes a linker, which turns the object file into an executable program.
Because interpreters read the code as it is written and execute the code on the spot, interpreters are easy for the programmer to work with. Compilers, however, introduce the extra steps of compiling and linking the code, which is inconvenient. Because the time-consuming task of translating the source code into machine language has already been accomplished, compilers produce a program that is very fast each time it is run.
The problems programmers are asked to solve have been changing. Today's programs use sophisticated "user-friendly interfaces," involving multiple windows, menus, and dialog boxes. The programs written to support this new approach are far more complex than those written just ten years ago. Generally, as programming requirements have changed, both languages and the techniques used for writing programs have evolved.
参考译文
计算机语言
自从第一批电子计算机诞生以来,计算机语言已经发生了戏剧性的变化。在早期,程序员使用最为原始的计算机指令──机器语言来工作,这些指令由一长串的0和1组成。不久,汇编语言发明了,它是把机器指令变换成易于阅读的助记符,如ADD、MOV等。
往后,又推出了高级语言,如PASCAL、BASIC、COBOL、C、C++、JA V A。这些语言使用的是近似于人们常用的词语或语句,如Let I=100。这些指令由解释器或编译器翻译成机器语言。解释器边读边翻译程序,把程序指令或代码直接变成动作。编译器把代码翻译成中间代码。这一步叫做编译,产生一个目标文件。接着,编译程序调用链接程序,由链接程序把目标文件变为可执行程序。
因为解释程序是读出代码就执行,所以程序员易于使用;但是编译程序却增加了一些额外的步骤来编译和链接代码,相比之下则不方便。可是编译程序产生的程序运行起来非常快,因为把源代码翻译成机器语言这一耗时的任务已经完成了。
程序员要解决的问题一直在变化。今天,程序使用了复杂的“用户友好界面”,包含多