L1 - Programming Languages
L1 - Programming Languages
LANGUAGES
By Sir. Joshua
Introduction
Computer program is a set of instructions that guide
a computer hardware to accomplish a specific task.
The act of creating a program is known as
programming.
When you write a computer program, you are
instructing the computer what to do and how to do
it.
In order to create computer programs, you need a
special language to instruct the computer.
Languages used to program the computer are
known as programming languages.
…
There are many types of programming languages such as C,
C++, C#, Java, JavaScript, Python, Ruby, and Visual Basics.
Programmers use programming language to construct
programs which are later commanded by a user to
accomplish a certain task.
Before creating programs, programmers should follow a
number of steps that are related to problem solving.
These steps comprise:
1. Defining and analysing the problem,
2. Designing or planning the solution,
3. Coding the program,
4. Testing and debugging the program
5. Documenting
Important terms used in
programming language
Source code
A source code, also known as codes, is a collection of
computer instructions written by a programmer in a
high-level or intermediate programming language.
It may include comments to aid with reasoning and
maintenance of a program.
The source code may be written in C++, Java,
Python, PHP and other languages.
A source code is machine independent.
…
Object code
An object code is a machine-readable code
in a binary format (0s and 1s) that is
obtained after converting source code.
The object code is also known as machine
code because it can only be read and
understood by the processor.
…
Translators
Translators are programming language
processors required to change a program
into the machine-readable languages.
There are three main categories of
translators namely assemblers,
interpreters and compilers.
Background to computer
programming languages
Historically,
computer programming
languageshave passed through five (5)
generations.
These generations can be divided into two
levels of programming languages:
Low-level programming languages
High-level programming languages
Low-level programming
languages
Low level programming languages are
characterized by little effort to translate
programs into machine readable forms.
They are not portable; hence, they are not easy
to be transferred from one computer to another.
Thereason for importability is due to the fact
that only the same processor of a particular
manufacturer that a language was designed for
can read the codes written in that computer for
processor to translate
…
Advantages:
Itis easier to understand if compared to machine
language.
Modifications are easy.
Correction & location of errors are easy.
Disadvantages :
Assembler is required.
This language is architecture /machine-dependent,
with a different instruction set for different machines.
Third generation programming
languages
Time Period: Late 1950s - 1970s
The third generation is also called procedural language /3
GL.
It consists of the use of a series of English-like words that
humans can understand easily, to write instructions.
For execution, a program in this language needs to be
translated into machine language using a Compiler/
Interpreter.
Examples of this type of language are C, PASCAL,
FORTRAN, COBOL, etc
…
Key Characteristics:
Higher abstraction from hardware.
Easier to write and debug.
Supports structured programming.
Examples:
Examples:
Advantages and Disadvantages
Advantages:
Easy to understand & learn.
Less time is required for application creation.
It is less prone to errors.
Disadvantages:
Memory consumption is high.
Has poor control over Hardware.
Less flexible.
Fifth generation programming
languages
Time Period: 1990s – Present
The fifth-generation languages are also called 5GL.
It is based on the concept of artificial intelligence.
It uses the concept that rather than solving a problem
algorithmically, an application can be built to solve it based on
some constraints, i.e., we make computers learn to solve any
problem.
These languages are designed to let computers solve problems on
their own with minimal human intervention.
Parallel Processing & superconductors are used for this type of
language to make real artificial intelligence.
Examples: PROLOG, LISP, etc.
…
Key Characteristics:
Focus on logic, inference, and constraints.
Used in AI, neural networks, machine learning, and
natural language processing.
Examples:
Advantages and Disadvantages
Advantages:
Machines can make decisions.
Programmer effort reduces to solve a
problem.
Easier than 3GL or 4GL to learn and use.
Disadvantages:
Complex and long code.
Moreresources are required & they are
expensive too.
Summary Table of Generations
Example
Generation Time Period Characteristics
Languages
Machine-level,
Late 1940s - Early
First Generation binary codes, Machine Code
1950s
hardware-specific