1. Basics
1. Basics
1
History of Programming Language
2
Computer Programming
• Computer programming is the process of designing, writing, testing, debugging
and maintaining the source code of computer programs.
• This source code is written in one or more programming languages (such as C+
+, C#, Java, Python, Smalltalk, etc.).
3
Purpose of Programming
• The purpose of programming is to create a set of instructions that computers use
to perform specific operations or to exhibit desired behaviors.
4
Type of Programming Language
• Machine languages
• Assembly languages
• Higher-level languages
5
Machine Languages
• Machine languages (first-generation languages) are the most basic type of
computer languages, consisting of strings of numbers the computer's hardware
can use.
• Different types of hardware use different machine code. For example, IBM
computers use different machine language than Apple computers
6
Assembly Languages
• Assembly languages (second-generation languages) are only somewhat easier to
work with than machine languages.
• The code is then translated into object code, using a translator called an
assembler.
7
Assembly
code
Assembler
Object
code 8
Higher-Level Languages
• Higher-level languages are more powerful than assembly language and allow
the programmer to work in a more English-like environment.
• Third-generation languages
• Fourth-generation languages
• Fifth-generation languages
9
10
11
Languages!
12
Translator
• Translators are just computer programs which accept a
program written in high level or low level language and
produce an equivalent machine level program as output.
Translators are of three types:
▪ Assembler
▪ Compiler
▪ Interpreter
13
Assembler
• Assembler is used for converting the code of low level language (assembly
language) into machine level language.
14
Compiler
• The compiler is one kind of system software that translates
the programs written in high level language to machine
language.
15
Interpreter
• The interpreter is a system software which use to convert
high level language programs to machine language. But it
convert one line at a time and execute it then it convert
next line and so on.
16
Compiler vs Interpreter
• A complier converts the high level instruction into machine language while an
interpreter converts the high level instruction into an intermediate form.
• The compiler executes the entire program at a time, but the interpreter executes
each and every line individually.
• List of errors is created by the compiler after the compilation process while an
interpreter stops translating after the first error.
• Autonomous executable file is generated by the compiler while interpreter is
compulsory for an interpreter program.
• Interpreter is smaller and simpler than compiler
• Interpreter is slower than compiler.
17
Compiler vs Interpreter
18