1 - Introduction To Programming
1 - Introduction To Programming
Programming
MIDTERM CHAPTER 1
Objectives of the lesson
https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
What is a paradigm?
https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
imperative
imperative
• Imperative programming paradigm:
It is one of the oldest programming paradigm. It features
close relation to machine architecture. It is based on Von
Neumann architecture. It works by changing the program
state through assignment statements. It performs step by
step task by changing state.
• The main focus is on how to achieve the goal. The
paradigm consist of several statements and after execution
of all the result is stored.
https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
imperative
• Examples of Imperative programming paradigm:
• C : developed by Dennis Ritchie and Ken Thompson
• Fortran : developed by John Backus for IBM
• Basic : developed by John G Kemeny and Thomas E
Kurtz
https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
imperative
• Advantage:
1.Very simple to implement
2.It contains loops, variables etc.
• Disadvantage:
1.Complex problem cannot be solved
2.Less efficient and less productive
3.Parallel programming is not possible
https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
imperative
https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
imperative
• Imperative programming is divided into three broad categories: Procedural, OOP and
parallel processing.
https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
imperative
• Object oriented programming – The program is written as a collection
of classes and object which are meant for communication. The smallest
and basic entity is object and all kind of computation is performed on
the objects only. More emphasis is on data rather procedure. It can
handle almost all kind of real life problems which are today in scenario.
Advantages:
•Data security
•Inheritance
•Code reusability
•Flexible and abstraction is also present
https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
imperative
• Examples of Object Oriented programming paradigm:
https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
OOP EXAMPLE
https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
Parallel processing
• Parallel processing approach
• Parallel processing is the processing of program instructions by
dividing them among multiple processors.
• A parallel processing system posses many numbers of processor
with the objective of running a program in less time by dividing them.
This approach seems to be like divide and conquer.
• Examples are NESL (one of the oldest one) and C/C++ also supports
because of some library function.
https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
declarative
Declarative programming
• Declarative programming paradigm:
• Declarative programming is a programming paradigm in which
the programmer defines what needs to be accomplished by the
program without defining how it needs to be implemented. In
other words, the approach focuses on what needs to be
achieved instead of instructing how to achieve it.
• The declarative programming approach helps in simplifying the
programming behind some parallel processing applications.
• Prolog, SQL and embedded SQL are some of the well-known
examples of declarative programming languages.
https://www.techopedia.com/definition/18763/declarative-programming
Declarative programming
• Logic programming paradigms
• It can be termed as abstract model of computation. It would solve
logical problems like puzzles, series etc. In logic programming we
have a knowledge base which we know before and along with the
question and knowledge base which is given to machine, it
produces result.
• In logical programming the main emphasize is on knowledge base
and the problem. The execution of the program is very much like
proof of mathematical statement, e.g., Prolog
https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
Declarative programming
• Functional programming paradigms –
The functional programming paradigms has its roots in mathematics
and it is language independent.
• The key principle of this paradigms is the execution of series of
mathematical functions.
• Examples of Functional programming paradigm:
• JavaScript : developed by Brendan Eich
• Haskell : developed by Lennart Augustsson, Dave Barton
• Scala : developed by Martin Odersky
• Erlang : developed by Joe Armstrong, Robert Virding
• Lisp : developed by John Mccarthy
• ML : developed by Robin Milner
• Clojure : developed by Rich Hickey
https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
Declarative programming
• Database/Data driven programming approach –
• This programming methodology is based on data and its movement.
• Program statements are defined by data rather than hard-coding a
series of steps.
• A database program is the heart of a business information system
and provides file creation, data entry, update, query and reporting
functions.
• There are several programming languages that are developed mostly
for database application. For example SQL, MySql etc.
https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
Declarative programming
https://www.geeksforgeeks.org/introduction-of-programming-paradigms/
Integrative
development
environment
dEFINITION A main is a predefined
keyword or function in C. It
02 is the first function of every
01 03
C program that is
<stdio.h> is header file for
The conio.h header file used in C responsible for starting
Standard Input Output,
programming language contains the execution and
“<stdlib.h>” is header file for
functions for console input/output. termination of the
Standard Library.
program.