Programming can be classified into several paradigms or styles, each with its own approach to solving problems. The four most commonly referenced types are:
This paradigm is based on the concept of procedure calls, where code is organized into procedures or functions. It focuses on a step-by-step sequence of instructions. Examples include C, Pascal, and BASIC.
OOP organizes code around objects and data rather than actions and logic. It promotes concepts such as encapsulation, inheritance, and polymorphism. Common OOP languages are Java, C++, Python, and C#.
Functional programming treats computation as the evaluation of mathematical functions and avoids changing state and mutable data. It emphasizes the use of pure functions and immutability. Examples include Haskell, Lisp, and parts of JavaScript.
Logic programming is based on formal logic. Programs are written as sets of logical statements expressing facts and rules about a problem domain. The most notable language in this paradigm is Prolog.
Other paradigms also exist, such as event-driven, declarative, and concurrent programming, but the above four are the primary foundational types.