0% found this document useful (0 votes)
6 views

L0 - Overview of Programming Language

Uploaded by

winersgoto
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

L0 - Overview of Programming Language

Uploaded by

winersgoto
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

L0 – Overview of

Programming Language
By
Dr. Mubarak Sufyan

1
Agenda
 Programming Languages (PL)
 Generations of PL
 Category of PL
 Levels of PL
 What is a programming?
 Utility Programs
 Test Software

2
Programming Languages
 Definition:
 is a set of rules that provides a way of telling a computer what operations to perform.
 Computer programs, known as software, are instructions that tell a computer what to do.
 It provides a linguistic framework for describing computations
 Computers do not understand human languages,
 so programs must be written in a language a computer can use.
 There are hundreds of programming languages, and
 they were developed to make the programming process easier for people.
 Which Programming Language is the Best?
 Knowing that there are so many programming languages available, it would be natural for you to
wonder which one is best.
 But, in truth, there is no “best” language.
 Each one has its own strengths and weaknesses.
 However, all programs must be converted into the instructions the computer can execute.
3
Programming Languages (2)
 English is a natural language.
 It has words, symbols and grammatical rules.
 A programming language also has words, symbols and rules of grammar.
 The grammatical rules are called syntax.
 Each programming language has a different set of syntax rules.
 However, all programs must be converted into the instructions the computer can
execute.

4
Generations of Programming Languages
• First generation:
• Machine Language:
• Operation code – such as addition or subtraction.
• Operands – that identify the data to be processed.
• Machine language is machine dependent as it is the only language the computer can
understand.
• Very efficient code but very difficult to write.
• Second generation:
• Assembly language.
• Symbolic operation codes replaced binary operation codes.
• Assembly language programs needed to be “assembled” for execution by the computer.
Assembly language instructions will translated into machine language instructions.
• Very efficient code and easier to write.
• Third Generation:
o Closer to English but included simple mathematical notation.
o Programs are written in source code, and must be translated into machine language
programs (called object code).
o The translation of source code to object code is accomplished by a machine
language system program called a compiler.
o Such as, FORTRAN、COBOL、C and C++、Visual Basic.
5
Generations of Programming Languages (2)
• Fourth Generation:
o A high level language that requires fewer instructions to accomplish a task than a third
generation language.
o Used with databases:
▪ Query languages,
▪ Report generators,
▪ Forms designers, and
▪ Application generators
• Fifth Generation:
o Declarative languages.
o Functional: Lisp, Scheme, SML.
o Also called applicative.
o Everything is a function.
o Logic: Prolog.
o Based on mathematical logic.
o Rule- or Constraint-based 6
Category of Programming Languages
• The principal paradigms o Objects are created rather than
o Imperative Programming --- compiler. sequences of instructions
▪ Procedure: Fortran, ALGOL, COBOL and o Some third generation, and fourth and
BASIC, Pascal and C. fifth generation languages
▪ Object-Oriented Programming (C++, o Such as:
Java) . o Simula:
o Declarative Programming : ▪ First object-oriented language
▪ Developed by Ole Johan Dahl in the
▪ Logic: Prolog.
1960s.
▪ Functional/Applicative Programming
o Smalltalk
(Lisp) ▪ First purely object-oriented language.
• Procedure programming languages: ▪ Developed by Xerox in mid-1970s.
• Sequences of instructions
• First, second and some third generation ▪ Still in use on some computers.
languages
• Object-Oriented Programming Languages 7
Levels of Programming Languages

 High-level languages:
 Java, Python, C, C++, PHP, Ruby, and
JavaScript.
 Low-level languages:
 It is a machine language and only a
computer is capable of reading and
interpreting the low-level languages of a
collection of binary digits or bits.

8
Levels of Programming Languages (2)

 Machine Language (low-level language):


 A computer’s native language, which differs among different types of
computers
 a set of built-in primitive instructions.
 These instructions are in the form of binary code, so if you want to give a
computer an instruction in its native language, you have to enter the
instruction as binary code.
 For example, to add two numbers, you might have to write an instruction
in binary code,
like this: 1101101010011010

9
Levels of Programming Languages (3)
 Assembly Language (low-level language):
 Programming in machine language is a tedious process.
 Moreover, programs written in machine language are very difficult to read and modify.
 was created in the early days of computing as an alternative to machine languages
 uses a short descriptive word, known as a mnemonic, to represent each of the machine-language
instructions
 For example, the mnemonic add typically means to add numbers and sub means to subtract
numbers.
 To add the numbers 2 and 3 and get the result, you might write an instruction in assembly code

like this: add 2, 3, result

10
Levels of Programming Languages (4)
 High-Level Language:
 In the 1950s, a new generation of programming languages known as high-level languages
emerged.
 They are platform independent, which means that you can write a program in a high-
level language and run it in different types of machines.
 High-level languages are English-like and easy to learn and use
 The instructions in a high-level programming language are called statements.
 For example, is a high-level language statement that computes the area of a circle with
a radius of 5:
area = 5 * 5 * 3.14159;
 A program written in a high-level language is called a source program or source code.
 Because a computer cannot execute a source program, a source program must be
translated into machine code for execution.
 The translation can be done using another programming tool called an interpreter or a
compiler. 11
Levels of Programming Languages (5)
 High-Level Language
(cont…):
 There are many
high-level
programming
languages, and
each was designed
for a specific
purpose.
 Table 1.1 lists
some popular
ones.

12
Levels of Programming Languages (6)

13
Compiling a high-level program and executing it

14
What is a Programming?
 Definition
 Is a system of notation for writing computer programs.
 Are described in terms of their syntax (form) and semantics (meaning), usually defined
by a formal language.
 The Key for programming
 If you learn to program using one language,
 you should find it easy to pick up other languages.
 The key is to learn how to solve problems using a programming approach.
 Example: A loader :
 is a program that places programs into memory and prepares them for execution.
 It would be more efficient if subroutines could be translated into object form the loader could”
relocate” directly behind the user’s program.
 The task of adjusting programs other may be placed in arbitrary core locations is called relocation.
15
Utility Programs

 A utility program performs a specialized task that enhances the computer’s


operation or safeguards data.
 Examples of utility programs are
 virus scanners,
 file compression programs, and
 data backup programs.
 Software Development Tools
 The programs that programmers use to create, modify, and test software.
 An example are
 Assemblers, Compilers, Interpreter.

16
Test Software

 Definition:
 is a software which is used to test the source code to execute and give us the required
results.
 Why?
 Source Code written by High-Level Language.
 Source Code must be translated into machine language.
 Because the CPU understands only machine language instructions.
 Depending on the language that a program has been written in.
 The programmer will use either a compiler or an interpreter to make the
translation.

17
End

18

You might also like