Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • DSA Tutorial
  • Data Structures
  • Algorithms
  • Array
  • Strings
  • Linked List
  • Stack
  • Queue
  • Tree
  • Graph
  • Searching
  • Sorting
  • Recursion
  • Dynamic Programming
  • Binary Tree
  • Binary Search Tree
  • Heap
  • Hashing
  • Divide & Conquer
  • Mathematical
  • Geometric
  • Bitwise
  • Greedy
  • Backtracking
  • Branch and Bound
  • Matrix
  • Pattern Searching
  • Randomized
Open In App
Next Article:
Difference Between Imperative and Declarative Programming
Next article icon

Difference between Functional and Imperative Programming

Last Updated : 15 Mar, 2021
Comments
Improve
Suggest changes
Like Article
Like
Report

Functional Programming: Functional Programming, as the name suggests, is a type of programming paradigm that is being created explicitly simply to support a purely functional approach to solving problems. This type of programming is mainly used when solutions are easily expressed in function and have very little physical meaning. It simply helps us to solve problems effectively in a simpler way. It also allows functions to be treated as ordinary values because, in functional programming, functions may freely operate on functions as parameters and return new functions as return values. It is a form of declarative programming. It is considered one of the popular programming paradigms that do computation like mathematical functions without changing state and mutating data.

For Example: Python, Clojure, Haskell, Lisp, etc.

Imperative Programming: Imperative Programming, as the name suggests, is a type of programming paradigm that specifies steps that computers should take to complete or finish a goal. In this, functions are coded implicitly in each and every step that is required to solve a problem. In simple words, it includes commands for the computer to perform. Programs are written more quickly and applications are also easier to optimize. It allows functions to be treated as special case constructs because, in imperative programming, it is rare to allow entire method calls to be returned from a method. It is a form of algorithmic programming.

For Example: Java, Fortran, Pascal, C, C++, etc.

Tabular difference between Functional Programming and Imperative Programming:

Functional Programming

Imperative Programming

It is generally a process of developing software simply by composing pure functions, avoiding or minimizing side effects, shared data, and mutable data.It is generally a process of describing steps that simply change the state of the computer.
It mainly focuses on what programs should be executed or operate i.e., results.It mainly focuses on describing how the program executes or operates i.e., process.
It uses functions to perform everything.It uses statements that change a program’s state.
Its advantages include bugs-free code, increase performance, better encapsulation, increase reusability, increase testability, etc.Its advantages include easy to learn, easy to read, a conceptual model is easy to learn, etc.
Its characteristics include low importance of the order of execution, stateless programming model, primary manipulations units, primary flow control, etc.Its characteristics include a sequence of statements, contain state and can change state, might have some side effects, stateful programming model, etc.
These programs are generally structured as successive nested functional calls.These programs are structured as successive assignments of values to variable names.
In this, the command execution order is not fixed.In this, the command execution order is fixed.
It involves writing programs in terms of functions and mathematical structures.It involves writing programs as series of instructions or statements that can actively modify memory.
It is more expressive and safer as compared to imperative programming.It is less expressive and safer than compared functional programming.
It requires the explicit representation of data structures that are used.It requires data structure to be represented as changes to state.
In this, new values are usually associated with the same name through command repetition.In this, new values are usually associated with different names through recursive function call nesting.

Next Article
Difference Between Imperative and Declarative Programming
author
madhurihammad
Improve
Article Tags :
  • Competitive Programming
  • Difference Between
  • DSA

Similar Reads

  • Difference Between Functional and Logical Programming
    Programming paradigm is an approach to solve problems using some programming language or also we can say it is a method to solve a problem using tools and techniques that are available to us following some approach. There are lots of programming languages that are known but all of them need to follo
    3 min read
  • Difference between Program and Function
    1. Program : Program, as name suggest, are set or collection of instructions used by computer to execute specific task and these are created using particular programming languages such as C++, Python, Ruby, etc. 2. Function : Function, as name suggests, is basic concept in computer programming that
    2 min read
  • Difference Between Imperative and Declarative Programming
    A programming paradigm is an approach to solve problems using some programming language or also we can say it is a method to solve a problem using tools and techniques that are available to us following some approach. There are lots of programming languages that are known but all of them need to fol
    3 min read
  • Difference between Functional Programming and Object Oriented Programming
    What is Functional Programming?In functional programming, we have to build programs using functions. An example of functional programming is Haskell language. What is Object Oriented Programming?Object-oriented programming is built by using classes and objects. In this, we have concepts of encapsula
    3 min read
  • Difference Between Function and Method
    Function: A Function is a reusable piece of code. It can have input data on which it can operate (i.e. arguments) and it can also return data by having a return type. It is the concept of procedural and functional programming languages. Method: The working of the method is similar to a function i.e.
    2 min read
  • Differences between Procedural and Object Oriented Programming
    This article focuses on discussing the differences between procedural and object-oriented programming. Procedural Programming Procedural Programming can be defined as a programming model which is derived from structured programming, based upon the concept of calling procedure. Procedures, also known
    2 min read
  • Difference between Function and Procedure
    Pre-requisites: What is SQL? Structured Query Language is a computer language that we use to interact with a relational database.SQL is a tool for organizing, managing, and retrieving archived data from a computer database. In this article, we will see the difference between Function and Procedure.
    3 min read
  • Difference Between Unit Tests and Functional Tests
    The article focuses on discussing the differences between Unit Testing and Functional Testing. The following topics will be discussed here: What is Unit Testing?What is Functional Testing?Unit Testing vs Functional Testing Let's start discussing each of these topics in detail. What is Unit Testing?
    3 min read
  • Swift - Difference Between Function and Method
    Some folks use function and method interchangeably and they think function and method are the same in swift. But, function and method both are different things and both have their advantages. In the code, Both function and method can be used again but methods are one of these: classes, structs, and
    4 min read
  • Differences between Functional and Non-functional Testing
    What is Functional Testing?Functional testing is a type of software testing in which the system is tested against the functional requirements and specifications. Functional testing ensures that the requirements or specifications are properly satisfied by the application. This type of testing is part
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences