Immam Assignment 401
Immam Assignment 401
Immam Assignment 401
Imperative programming
Declarative programming
Object oriented programming
Functional programming
Event driven programming
Automata based programming
1. Imperative programming
The imperative (or procedural) paradigm is the closest to the structure of actual computers.
-
It is a model that is based on moving bits around and changing machine state
Programming languages based on the imperative paradigm have the following characteristics:
i.
The basic unit of abstraction is the PROCEDURE, whose basic structure is a sequence of
statements that are executed in succession, abstracting the way that the program counter
is incremented so as to proceed through a series of machine instructions residing in
sequential hardware memory cells.
The sequential flow of execution can be modified by conditional and looping statements
ii.
(as well as by the very low-level goto statement found in many imperative languages),
which abstract the conditional and unconditional branch instructions found in the
iii.
Julia,
Lua,
MATLAB,
Machine language, Modula-2, Modula-3, MUMP, Nim, Oberon, Object Pascal, OCaml,
Pascal, Perl, PHP, PROSE, Python, Ruby, Rust, Wolfram Language
2. Functional programming
Functional programming is a programming paradigma style of building the structure and
elements of computer programsthat treats computation as the evaluation of mathematical
functions and avoids changing-state and mutable data
Many functional languages are tied to mathematical calculation tools. Functional languages
include:
Pure:
Agda, Charity, Clean, Coq (Gallina), Curry, Elm, Frege, Haskell, Hope, Joy, Mercury, Miranda,
Idris, SequenceL.
Impure:
APL, ATS, CAL, C, C++, C#, Ceylon, D, Dart, Curl, ECMAScript (ActionScript,
ECMAScript for XML, JavaScript and Jscript), Elm, Erlang (Elixir and LFE), F#, FPr, Groovy,
Hop, J, Java, Julia, Lisp, Tea, Mathematica, ML, Nemerle, Opal, OPS5, poplog, python, Q
( equational programming languages), Q (programming language from Kx systems), R, REBOL,
ruby, REFAL, rust, Scala, Spreadsheets, Wolfram languages.
3. Object Oriented Programming
FEATURES OF OOP:
1. Object
2. Class
3. Data Hiding and Encapsulation
4. Dynamic Binding
5. Message Passing
6. Inheritance
7. Polymorphism
OBJECT: Object is a collection of number of entities. Objects take up space in the memory.
Objects are instances of classes. When a program is executed, the objects interact by sending
messages to one another. Each object contain data and code to manipulate the data. Objects can
interact without having known details of each others data or code.
CLASS: Class is a collection of objects of similar type. Objects are variables of the type class.
Once a class has been defined, we can create any number of objects belonging to that class. Eg:
grapes bannans and orange are the member of class fruit.
DATA ABSTRACTION AND ENCAPSULATION:
Combining data and functions into a single unit called class and the process is known as
Encapsulation. Data encapsulation is important feature of a class. Class contains both data and
functions. Data is not accessible from the outside world and only those function which are
present in the class can access the data. The insulation of the data from direct access by the
program is called data hiding or information hiding. Hiding the complexity of program is called
Abstraction and only essential features are represented. In short we can say that internal
working is hidden.
DYNAMIC BINDING: Refers to linking of function call with function definition is called
binding and when it is take place at run time called dynamic binding.
MESSAGE PASSING: The process by which one object can interact with other object is called
message passing.
INHERITANCE: it is the process by which object of one class aquire the properties or features
of objects of another class. The concept of inheritance provide the idea of reusability means we
can add additional features to an existing class without modifying it. This is possible by driving a
new class from the existing one. The new class will have the combined features of both the
classes.
POLYMORPHISM: A Greek term means ability to take more than one form. An operation may
exhibit different behaviors in different instances. The behavior depends upon the types of data
used in the operation.
Examples of Object oriented programming
ActionScript 3.0, Actor, Ada 95 and Ada 2005, BETA, Blue, C++, C#, Ceylon,
Oxygene( formerly known as Chrome), Chuck, Cobra, ColdFusion, Curl, D, DASL, Delphi, E,
GNU E, eC, Eiffel, F-Script, Fortran 2003, Fortress, FPr, Gambas, Game maker language,
Harbour, J, Java, LabVIEW, Lava, Lua, Modula-2, Modula-3, Nemerle, IBM NetRexx, Oberon2, Object Pascal, Object REXX, Objective-C, OCaml, Oz, Mozart programming System, Perl 5,
PHP, Pike, Prograph, Python, Realbasic, Ruby, Scala, Simula, Smalltalk, SPIN, SuperColider,
Transcript, VBScript, Visual DataFlex, Visual FoxPro, Visual Prolog, X++, XOTcl.
4. Declarative programming
Declarative programming is a programming paradigm that deals with the style of building the
structure and elements of computer programs- that expresses the logic of a computation
without describing its control flow.
Declarative languages allow the programmer to concentrate on the logic of an algorithm
(declarative languages are goal driven, control is not the concern of the programmer). These are
the following features of declarative programming languages:
1. Assignment
2. Data structures
3. Order of execution
4. Expressions and definitions as values
5. Control
Examples of declarative programming language consists:
C++, Clojure, Coffeescript,[2] Elixir, Erlang, F#, Haskell, Lisp, Python, Ruby, Scala,
SequenceL, SML, SQL, regular expressions, CSS, Prolog, OWL, SPARQL
Event driven programs respond to events triggered by the user via the mouse or
keyboard
Common user events include clicking the mouse, pressing a key, changing text
Different controls have different events (events for a text box not the same for a
button)
The programmer chooses which event(s) to respond to by selecting the appropriate
trigger function.
Event Handlers
-
Procedures
or Subroutines
VB.NET uses Sub /End Sub to start and end the code
This allows the programmer to work on one event of one control at a time and makes
testing easier
Event Loops
-
appropriate event handler to run the code written for this purpose
Other (non user) activities can also cause an event to trigger typically used in
networking and when reading from or writing to files
body. The step section might be divided down to subsections to be executed depending on
different states, although this is not necessary.
Any communication between the steps is only possible via the explicitly noted set of variables
named the state. Between any two steps, the program (or its part created using the automatabased technique) cannot have implicit components of its state, such as local (stack) variables'
values, return addresses, the current instruction pointer, etc. That is, the state of the whole
program, taken at any two moments of entering the step of the automaton, can only differ in the
values of the variables being considered as the state of the automaton.
Examples of Automata based Programming is AsmL.
References:
i.
ii.
iii.
iv.
v.
vi.
vii.
viii.
https://en.wikipedia.org/wiki/Comparison_of_programming_paradigm
s
https://en.wikipedia.org/wiki/Object-oriented_programming
https://en.wikipedia.org/wiki/Imperative_programming
https://en.wikipedia.org/wiki/Functional_programming
https://en.wikipedia.org/wiki/Event-driven_programming
https://en.wikipedia.org/wiki/Automata-based_programming
http://www.slideshare.net/nileshdalvi01/basics-concepts-of-oops
http://www.slideshare.net/nileshdalvi01/eventdriventheory
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: