Info

High-Level Languages

Although assembly language makes it unnecessary to write binary machine language instructions, it is not without difficulties. Assembly language is primarily a direct substitute for machine language, and like machine language, it requires that you know a lot about the CPU. Assembly language also requires that you write a large number of instructions for even the simplest program. Because assembly language is so close in nature to machine language, it is referred to as a low-level language.

In the 1950s, a new generation of programming languages known as high-level languages began to appear. A high-level language allows you to create powerful and complex programs without knowing how the CPU works, and without writing large numbers of low-level instructions. In addition, most high-level languages use words that are easy to understand. For example, if a programmer were using COBOL (which was one of the early high-level

2 The first assembly language was most likely that developed in the 1940s at Cambridge University for use with a historic computer known as the EDSAC.

languages created in the 1950s), he or she would write the following instruction to display the message Hello world on the computer screen:

DISPLAY "Hello world"

Python is a modern, high-level programming language that we will use in this book. In Python you would display the message Hello world with the following instruction:

print 'Hello world'

Doing the same thing in assembly language would require several instructions, and an intimate knowledge of how the CPU interacts with the computer's output device. As you can see from this example, high-level languages allow programmers to concentrate on the tasks they want to perform with their programs rather than the details of how the CPU will execute those programs.

Since the 1950s, thousands of high-level languages have been created. Table 1-1 lists several of the more well-known languages.

Table 1-1 Programming languages

Language Description

Ada Ada was created in the 1970s, primarily for applications used by the U.S.

Department of Defense. The language is named in honor of Countess Ada Lovelace, an influential and historic figure in the field of computing.

BASIC Beginners All-purpose Symbolic Instruction Code is a general-purpose language that was originally designed in the early 1960s to be simple enough for beginners to learn. Today, there are many different versions of BASIC.

FORTRAN FORmula TRANslator was the first high-level programming language. It was designed in the 1950s for performing complex mathematical calculations.

COBOL Common Business-Oriented Language was created in the 1950s, and was designed for business applications.

Pascal Pascal was created in 1970, and was originally designed for teaching program ming. The language was named in honor of the mathematician, physicist, and philosopher Blaise Pascal.

C and C++ C and C++ (pronounced "c plus plus") are powerful, general-purpose languages developed at Bell Laboratories. The C language was created in 1972 and the C++ language was created in 1983.

C# Pronounced "c sharp." This language was created by Microsoft around the year 2000 for developing applications based on the Microsoft .NET platform.

Java Java was created by Sun Microsystems in the early 1990s. It can be used to develop programs that run on a single computer or over the Internet from a web server.

JavaScript JavaScript, created in the 1990s, can be used in web pages. Despite its name, JavaScript is not related to Java.

Python Python, the language we use in this book, is a general-purpose language created in the early 1990s. It has become popular in business and academic applications.

Ruby Ruby is a general-purpose language that was created in the 1990s. It is increas ingly becoming a popular language for programs that run on web servers.

Visual Basic Visual Basic (commonly known as VB) is a Microsoft programming language and software development environment that allows programmers to create Windows-based applications quickly. VB was originally created in the early 1990s.

Key Words, Operators, and Syntax: an Overview

Each high-level language has its own set of predefined words that the programmer must use to write a program. The words that make up a high-level programming language are known as key words or reserved words. Each key word has a specific meaning, and cannot be used for any other purpose. You previously saw an example of a Python statement that uses the key word p r i n t to print a message on the screen. Table 1-2 shows all of the Python key words.

Table 1 -2 The Python key words

and

del

from

not

while

a s

elif

global

o r

with

assert

else

i f

pass

yiel

break

except

import

print

Was this article helpful?

0 0

Post a comment