sd & d types of programming language
TRANSCRIPT
Types of programming languageThere are 3 types of programming language:
1.Procedural
2.Declarative
3.Object-Oriented
Procedural languages In a procedural language, the programmer specifies the
sequence of operations to be performed
A procedural program has a clear start point, and end point
Livecode, Python, BASIC and C are examples of procedural programming languages (although LiveCode can also be described as Event Driven)
Procedural languages Larger programs are broken down into smaller
subprograms, known as functions or procedures
Subprograms should have a specific purpose. Using subprograms means a program is modular.
Procedural languages provide the programmer with variable data types such as integers, real numbers and strings
Declarative languagesThe programmer declares all of the facts and rules at the
outset
Queries can then be performed on the facts and relationships in order to solve problems
Used in medical diagnosis, weather forecasting, financial projection and planning
Examples are PROLOG and LISP. Declarative languages are often used in artificial intelligence
Object-oriented languagesIn object-oriented programming (OOP) the language is
modelled around objects rather than actions
Objects can have attributes and methods
A car object can have the attributes:ColourEngine sizeNumber of doors
A car object can have the methods:Drive forwardBrakeUnlock doors
ClassesIn OOP we define a class as the blueprint for our objects
In our example, car is a class – it is not a specific make or model of car but a blueprint for all cars
We use our class to create an instance of an object
InheritanceObject-oriented programming allows classes to inherit
commonly used state and behaviour from other classes