Computer Science
(A Level)
Imperative, Declarative
and Object-Orientated
Languages
4th Generation Data query,
analysis and reporting
3rd Generation
Imperative
2nd Generation
Assembly
1st Generation
Machine code
High level languages
Low level languages
Programming Languages - Generations
High Level Programming
Languages
Imperative
Object
Oriented
Procedural
Declarative
Logic
Database
Query
Functional
Hierarchy of High Level Languages
Code is executed line by line,
in a programmer defined
sequence of commands and
procedures
(Definition)
Tech Pupil is a site
made by a
student to help
and assist others
in their computer
science courses,
aspirations and
learning.
Imperative
• Imperative language is also known as procedural
language.
• This works by typing in lists of instructions (subroutines
and procedures) that the computer has to follow. Every
time the computer program is run, it follows the same
set of instructions.
• Imperative programs are made up of sequence, selection
and iteration blocks
Advantages Disadvantages
• Quicker and easier to write and maintain • Slower code - lacks low level processors
functionality
• Hardware independent – it is written
and can be used many times
• There are many procedural languages
therefore a programmer may only learn
and know one language.
• Time saving programmer friendly, one
of 3rd gen is the equivalent of many lines
of 1st and 2nd gen
• Need to be very precise and
knowledgeable about programming
instructions, and so a fully de-bugged
working program takes more time to put
together
• Good level of control without having to
know precise target CPU details
• Doesn’t deal well with ideas and concepts
• Portable source code
Imperative
A language that condenses data
and instructions together into
objects
(Definition)
Tech Pupil is a site
made by a
student to help
and assist others
in their computer
science courses,
aspirations and
learning.
Object-Orientated
• Object orientated languages are organised around objects
and data instead of actions and logic.
• The operations in this type of languages can modify object
behaviour. In other words, it can change an object by
manipulating variables.
• These wok by creating objects where the instructions and
data required to run the program are contained within a
single object.
• Object orientated programming can be further grouped into
classes
A language that declares
what needs to be done
rather than how to do it
(Definition)
Tech Pupil is a site
made by a
student to help
and assist others
in their computer
science courses,
aspirations and
learning.
Declarative
• Declarative language is more problem-orientated than
machine-orientated.
• It works by describing what the program needs to
accomplish rather than how to do it.
• There are 2 types of declarative language
–Logic
–Functional
Tech Pupil is a site
made by a
student to help
and assist others
in their computer
science courses,
aspirations and
learning.
Declarative (Logic)
One type of declarative language is logic
programming, which is used widely in artificial
intelligence and works by programming in facts
and rules rather than instructions. The program
then uses the facts and rules to interrogate data
and provide results.
Tech Pupil is a site
made by a
student to help
and assist others
in their computer
science courses,
aspirations and
learning.
Declarative (Functional)
Another type of declarative language is a
functional language, which works by treating
procedures more like mathematical functions.
Therefore, the building blocks of the program
are functions rather than lists of instructions.
A language (part of
declarative language) that
uses mathematical functions
(Definition)
Characteristics of High Level Programming
• Easier to identify what a command does because the keywords
are like natural language
• High level languages need to be translated, just like assembly
language
• One to many relationship – one command in high level
languages is a whole sequence in machine code
• Portable
• Easier to maintain
• Makes use of wide variety of program structures to make
program writing more straightforward.

High Level Languages (Imperative, Object Orientated, Declarative)

  • 1.
    Computer Science (A Level) Imperative,Declarative and Object-Orientated Languages
  • 2.
    4th Generation Dataquery, analysis and reporting 3rd Generation Imperative 2nd Generation Assembly 1st Generation Machine code High level languages Low level languages Programming Languages - Generations
  • 3.
  • 4.
    Code is executedline by line, in a programmer defined sequence of commands and procedures (Definition)
  • 5.
    Tech Pupil isa site made by a student to help and assist others in their computer science courses, aspirations and learning. Imperative • Imperative language is also known as procedural language. • This works by typing in lists of instructions (subroutines and procedures) that the computer has to follow. Every time the computer program is run, it follows the same set of instructions. • Imperative programs are made up of sequence, selection and iteration blocks
  • 6.
    Advantages Disadvantages • Quickerand easier to write and maintain • Slower code - lacks low level processors functionality • Hardware independent – it is written and can be used many times • There are many procedural languages therefore a programmer may only learn and know one language. • Time saving programmer friendly, one of 3rd gen is the equivalent of many lines of 1st and 2nd gen • Need to be very precise and knowledgeable about programming instructions, and so a fully de-bugged working program takes more time to put together • Good level of control without having to know precise target CPU details • Doesn’t deal well with ideas and concepts • Portable source code Imperative
  • 7.
    A language thatcondenses data and instructions together into objects (Definition)
  • 8.
    Tech Pupil isa site made by a student to help and assist others in their computer science courses, aspirations and learning. Object-Orientated • Object orientated languages are organised around objects and data instead of actions and logic. • The operations in this type of languages can modify object behaviour. In other words, it can change an object by manipulating variables. • These wok by creating objects where the instructions and data required to run the program are contained within a single object. • Object orientated programming can be further grouped into classes
  • 9.
    A language thatdeclares what needs to be done rather than how to do it (Definition)
  • 10.
    Tech Pupil isa site made by a student to help and assist others in their computer science courses, aspirations and learning. Declarative • Declarative language is more problem-orientated than machine-orientated. • It works by describing what the program needs to accomplish rather than how to do it. • There are 2 types of declarative language –Logic –Functional
  • 11.
    Tech Pupil isa site made by a student to help and assist others in their computer science courses, aspirations and learning. Declarative (Logic) One type of declarative language is logic programming, which is used widely in artificial intelligence and works by programming in facts and rules rather than instructions. The program then uses the facts and rules to interrogate data and provide results.
  • 12.
    Tech Pupil isa site made by a student to help and assist others in their computer science courses, aspirations and learning. Declarative (Functional) Another type of declarative language is a functional language, which works by treating procedures more like mathematical functions. Therefore, the building blocks of the program are functions rather than lists of instructions.
  • 13.
    A language (partof declarative language) that uses mathematical functions (Definition)
  • 14.
    Characteristics of HighLevel Programming • Easier to identify what a command does because the keywords are like natural language • High level languages need to be translated, just like assembly language • One to many relationship – one command in high level languages is a whole sequence in machine code • Portable • Easier to maintain • Makes use of wide variety of program structures to make program writing more straightforward.