You are on page 1of 22

Computer Languages

Dr.VMS
Computer programming language

 Programming languages are used for expressing a set of


detailed instructions for a digital computer. Such
instructions can be executed directly when they are in
the computer manufacturer-specific numerical form
known as machine language, after a simple substitution
process when expressed in a corresponding assembly
language, or after translation from some “higher-level”
language.
Assembly language

 Assembly language is one level


above machine language. It uses
short mnemonic codes for instructions and allows the
programmer to introduce names for blocks of memory
that hold data. One might thus write “add pay, total”
instead of “0110101100101000” for an instruction that
adds two numbers.
Machine language
 The numeric codes for the operations that a particular computer can execute
directly. The codes are strings of 0s and 1s, or binary digits (“bits”), which
are frequently converted both from and to hexadecimal (base 16) for human
viewing and modification. Machine language instructions typically use
some bits to represent operations, such as addition, and some to represent
operands, or perhaps the location of the next instruction. Machine language
is difficult to read and write, since it does not resemble conventional
mathematical notation or human language, and its codes vary from
computer to computer.
High level languages
 High level languages are written in a form that is close to our human
language, enabling to programmer to just focus on the problem being
solved.

 No particular knowledge of the hardware is needed as high level


languages create programs that are portable and not tied to a particular
computer or microchip.

 Examples include: C++, Java, Pascal, Python, Visual Basic.


Low level languages
 Low level languages are used to write programs that relate to
the specific architecture and hardware of a particular type of
computer.

 They are closer to the native language of a computer (binary),


making them harder for programmers to understand.
 Examples of low level language:
 Assembly Language, Machine Code
 
High Level Language Low Level Language
 

1. It is programmer friendly language. It is a machine friendly language.

High level language is less memory

2. efficient. Low level language is high memory efficient.

3. It is easy to understand. It is tough to understand.

4. It is simple to debug. It is complex to debug comparatively.

5. It is simple to maintain. It is complex to maintain comparatively.

6. It is portable. It is non-portable.
COBOL

 COBOL (COmmon Business Oriented Language) was developed in the late 1950s by


computer manufacturers, the U.S. government and industrial computer users. COBOL is
used for commercial applications that require precise and efficient manipulation of large
amounts of data. Much business software is still programmed in COBOL.
FORTRAN
 The first important algorithmic language was FORTRAN (formula
translation), designed in 1957 by an IBM team led by John Backus. It was
intended for scientific computations with real numbers and collections of
them organized as one- or multidimensional arrays. Its control structures
included conditional IF statements, repetitive loops (so-called DO loops),
and a GOTO statement that allowed nonsequential execution of program
code. FORTRAN made it convenient to have subprograms for common
mathematical operations, and built libraries of them.

 FORTRAN was also designed to translate into efficient machine language.


It was immediately successful and continues to evolve.
BASIC

 BASIC (beginner’s all-purpose symbolic instruction code) was designed at


Dartmouth College in the mid-1960s by John Kemeny and Thomas Kurtz. It
was intended to be easy to learn by novices, particularly non-computer
science majors, and to run well on a time-sharing computer with many users.
It had simple data structures and notation and it was interpreted: a BASIC
program was translated line-by-line and executed as it was translated, which
made it easy to locate programming errors.

 Its small size and simplicity also made BASIC a popular language for early
personal computers. Its recent forms have adopted many of the data and
control structures of other contemporary languages, which makes it more
powerful but less convenient for beginners.
Java

 In the early 1990s, Java was designed by Sun Microsystems, Inc., as a


programming language for the World Wide Web (WWW). Although it
resembled C++ in appearance, it was fully object-oriented. In particular, Java
dispensed with lower-level features, including the ability to manipulate data
addresses, a capability that is neither desirable nor useful in programs for
distributed systems. In order to be portable, Java programs are translated by a
Java Virtual Machine specific to each computer platform, which then executes
the Java program. In addition to adding interactive capabilities to the Internet
through Web “applets,” Java has been widely used for programming small
and portable devices, such as mobile telephones.
C
 C, computer programming language developed in the early 1970s by American
computer scientist Dennis M. Ritchie at Bell Laboratories (formerly AT&T Bell
Laboratories).
 C was designed as a minimalist language to be used in writing operating systems for
minicomputers, such as the DEC PDP 7, which had very limited memories compared
with the mainframe computers of the period.
 The language was devised during 1969–73, alongside the early development of the
UNIX operating system. It was based on CPL (Combined Programming Language),
which had been first condensed into the B programming language—a stripped-down
computer programming language—created in 1969–70 by Ken Thompson, an
American computer scientist and a colleague of Ritchie. Ritchie subsequently
rewrote and restored features from CPL to create C, eventually rewriting the UNIX
operating system in the new language.
Variables
 Variables are used to store information to be referenced and manipulated in a computer program. They also
provide a way of labeling data with a descriptive name, so our programs can be understood more clearly by the
reader and ourselves. It is helpful to think of variables as containers that hold information. Their sole purpose is
to label and store data in memory. This data can then be used throughout your program.
 For example, assume you want to store two values 10 and 20 in your program and at a later stage, you want to
use these two values. Let's see how you will do it. Here are the following three simple steps −
 Create variables with appropriate names.
 Store your values in those two variables.
 Retrieve and use the stored values from the variables.
 Creating variables
 Creating variables is also called declaring variables in C programming. Different programming languages
have different ways of creating variables inside a program. For example, C programming has the following
simple way of creating variables −
Variables
 #include <stdio.h>

 int main() {
 int a;
 int b;
 The above program creates two variables to reserve two memory locations
with names a and b. We created these variables using int keyword to specify
variable data type which means we want to store integer values in these two
variables.
Character

 Every letter, digit, and punctuation mark is a


character. There are also many characters that are
invisible on screen, such as the space, tab,
and carriage-return characters.
Strings

 The technical description of a String is: an array


of characters. The informal view of a string is a
sentence. Strings are almost always written in code
as a quoted sequence of characters, i.e., "this is a
string".
String
 Most programming languages have a data type called a string, which is
used for data values that are made up of ordered sequences of
characters, such as "hello world". A string can contain any sequence of
characters, visible or invisible, and characters may be repeated. The
number of characters in the string is called its length, and "hello world"
has length 11 - made up of 10 letters and 1 space. There is usually a
restriction on the maximum length of a string. There is also such a thing
as an empty string, which contains no characters - length 0.
 A string can be a constant or variable. If it is a constant, it is usually
written as a sequence of characters enclosed in single or double
quotation marks, ie 'hello' or "hello".
Statement

 Most programming languages have the concept of a statement. A statement is a


command that the programmer gives to the computer. For example:
 print "Hello, world!"
 This command has a verb (“print”) and other details (what to print). In this case, the
command print means “show on the screen,” not “print on the printer.” The
programmer either gives the statement directly to the computer (by typing it while
launching a special program), or creates a text file with the command in it. You could
create a file called “hi.txt” using a program like Notepad, put the above command in
it, and give the file to the computer.
Statement

 An instruction written in a high-level language. A statement directs the


computer to perform a specified action. A single statement in a high-level
language can represent several machine-language instructions. Programs
consist of statements and expressions. An expression is a group of symbols
that represent a value.
Operators and operands
 Operators are special symbols that represent computations like addition and multiplication. The values
the operator uses are called operands.

 The following are all legal Python expressions whose meaning is more or less clear:

 20+32 hour-1 hour*60+minute minute/60 5**2 (5+9)*(15-7)


 The symbols +, -, and /, and the use of parenthesis for grouping, mean in Python what they mean in
mathematics. The asterisk (*) is the symbol for multiplication, and ** is the symbol for exponentiation.

 When a variable name appears in the place of an operand, it is replaced with its value before the
operation is performed.
Thank You

You might also like