Programming paradigms
Contents
Programming paradigms#
Note
Programming paradigm is the ways or styles of writing code. Many languages support multiple paradigms.
Procedural programming#
Typical language: C
Object-oriented programming#
Typical languages: Java, Python, C++, C#
Object-oriented programming (OOP) is a programming paradigm based on the concept of “objects”, which can contain data and code. The data is in the form of fields, and the code is in the form of methods.
Main principals of OOP:
Encapsulation: Bundling the data and methods that operate on the data.
Abstraction: Reducing complexity by hiding unnecessary details.
Inheritance: Basing an object upon another object, retaining similar implementation.
Polymorphism: Provision of a single interface to entities of different types.
Functional programming#
Typical language: Haskell