Table of Contents
Introduction to Object Oriented Programming (OOPs)
Definition:
Programming paradigms are fundamental styles of programming that dictate how solutions to problems are structured and expressed.
Types:
- Imperative Programming: Focuses on how to execute, defining control flow as statements that change a program's state. There are two main types within imperative programming which are widely used nowadays : Functional Programming and Object Oriented Programing (OOPs)
- Declarative Programming: Focuses on what to execute, defining program logic without explicitly describing the control flow.
- Structured Programming: Enhances imperative programming by using a hierarchy of blocks or structures, making the code more understandable and manageable.
- Event-Driven Programming: The flow of the program is determined by events such as user actions (mouse clicks, key presses), sensor outputs, or message passing.
- Concurrent Programming: Allows multiple processes to be executed simultaneously, improving the performance of the program.
Imperative Programming:
Imperative programming is a paradigm where the programmer instructs the machine how to change its state. This involves writing sequences of commands for the computer to perform. Examples include:
- Variables: Used to store data that can be changed during program execution.
- Control Structures: Such as loops (
for
, while
) and conditionals (if
, switch
).
- Procedures/Functions: Blocks of code that perform a specific task.
Key Characteristics:
- Focus on How: Emphasizes the steps needed to solve a problem.
- State Changes: Frequent changes in the program's state through variables.
- Control Flow: Clear control flow through sequential instructions.
Functional Programming: