Monday, 22 February 2021

Programming Paradigms in PPL | Programming Language Paradigms | Paradigms in Programming

                      In this post, we will see Programming Paradigms in PPL | Programming Language Paradigms | Paradigms in Programming | programming paradigms in ppl,programming paradigms,programming paradigms in software engineering,language paradigms,programming language paradigms,programming paradigms in c language,programming paradigms in c++,programming paradigms in java,programming paradigms in python,paradigms in programming  


Programming Paradigms

                  Programming paradigms are a way to classify  programming languages based on their features. 

 

Two main types:

1. Imperative

       a. Procedural

       b. Object Oriented

2. Declarative

       a. Functional or Applicative

       b. Logic or Rule based

 

1. Imperative

How?

State

X=2, y=3

X=5, y=9

 

a. Procedural     

 

Procedure Call

 

e.g. C, Fortran, ALGOL,COBOL, PL/I, Basic, Pascal

  

b. Object Oriented   

 

Classes / Objects

 

e.g. C++, Java, Python, PHP, Perl, Scala

  

2. Declarative

What?

 

Expect result.. Properties

 

No state get changed

 

c. Functional / Applicative

e.g. Lisp, Javascript, Racket, Haskell

 

(+ 3 2)

 

(- 4 3)

 

(defun areaofcircle()

(write-line "Enter radius")

(setf radius (read))(setf a (* 3.14 radius radius))

(write-line "Area of circle:")

(write a)

)

 

d. Logic / Rule based

 

e.g. Prolog, Datalog, ASP (Answer Set Programming)

 

Facts & Rules

 

Rules / Clauses

 

H:-B1, B2......Bn

 

H if B1 and B2 and ..... Bn

 

Facts

 

H


Watch following video: 

Watch on YouTube: https://www.youtube.com/watch?v=mB4u4ETsn28

No comments:

Post a Comment