mirror of
https://github.com/ByteByteGoHq/system-design-101.git
synced 2026-04-01 16:57:23 -04:00
This PR adds all the guides from [Visual Guides](https://bytebytego.com/guides/) section on bytebytego to the repository with proper links. - [x] Markdown files for guides and categories are placed inside `data/guides` and `data/categories` - [x] Guide links in readme are auto-generated using `scripts/readme.ts`. Everytime you run the script `npm run update-readme`, it reads the categories and guides from the above mentioned folders, generate production links for guides and categories and populate the table of content in the readme. This ensures that any future guides and categories will automatically get added to the readme. - [x] Sorting inside the readme matches the actual category and guides sorting on production
47 lines
1.6 KiB
Markdown
47 lines
1.6 KiB
Markdown
---
|
|
title: "Imperative vs Functional vs Object-oriented Programming"
|
|
description: "Explore imperative, functional, and object-oriented programming paradigms."
|
|
image: "https://assets.bytebytego.com/diagrams/0035-imperative-vs-functional-vs-oop.png"
|
|
createdAt: "2024-03-09"
|
|
draft: false
|
|
categories:
|
|
- software-development
|
|
tags:
|
|
- Programming Paradigms
|
|
- Software Design
|
|
---
|
|
|
|

|
|
|
|
In software development, different programming paradigms offer unique ways to structure code. Three main paradigms are Imperative, Functional, and Object-oriented programming, each with distinct approaches to problem-solving.
|
|
|
|
## Imperative Programming
|
|
|
|
* Works by changing program state through a sequence of commands.
|
|
|
|
* Uses control structures like loops and conditional statements for execution flow.
|
|
|
|
* Emphasizes mutable data and explicit steps for task completion.
|
|
|
|
* Examples: C, Python, and most procedural languages.
|
|
|
|
## Functional Programming
|
|
|
|
* Relies on pure functions, emphasizing computation without side effects.
|
|
|
|
* Promotes immutability and the avoidance of mutable state.
|
|
|
|
* Supports higher-order functions, recursion, and declarative programming.
|
|
|
|
* Examples: Haskell, Lisp, Scala, and functional features in languages like JavaScript.
|
|
|
|
## Object-oriented Programming
|
|
|
|
* Focuses on modeling real-world entities as objects, containing data and methods.
|
|
|
|
* Encourages concepts such as inheritance, encapsulation, and polymorphism.
|
|
|
|
* Utilizes classes, objects, and interfaces to structure code.
|
|
|
|
* Examples: Java, C++, Python, and Ruby.
|