Programming Paradigms and Programming Languages Types

Wen
3 min readJan 27, 2020

--

A programming paradigm is a programming style, an approach to programming, your way to problem-solving.

(Note that it is wrong to say “programming language paradigm”)

It is independent of programming languages, but some languages are not designed to implement some paradigms. Most problems have many ways (paradigms) to solve them.

However, solving some types of problems naturally leads to using certain paradigms, such as using OOP for creating interacting robot characters.

The following summarizes the most popular and important paradigms used in computer programming.

Note that there are different ways to categorize programming languages, such as compiled vs. interpreted.

Source: LearntoCodeWith

Compiled programming language: pack of code is converted into machine code first, and then it is run. Eg) C, C++

  • Environment-dependent for the generated machine code
  • Slow to test for large programs

Interpreted programming language: code is translated into machine code and run line by line. Eg) Python, JavaScript

  • Easy for testing
  • Dynamic typing, flexible
  • Relatively slower compilation time

Programming Paradigms

Source: GeeksforGeek

Imperative programming: changes the state of the program step by step through each command. It emphasis process, or how the program accomplishes its purposes. Order is crucial. It is the oldest programming style.

  • Disadvantages: side effects, difficult to understand, less efficient.

Declarative programming: emphasis on the goal, or what the program should return. It does not care about the process as much as long as the goal is accomplished.

Object-Oriented Programming (OOP)

OOP is a software programming model constructed around objects. It views that world as a system of interacting objects.

This programming language views the world as a group of objects that have internal data and external accessing parts of that data. The aim […] is to think about the fault by separating it into a collection of objects that offer services that can be used to solve a specific problem.(Article: “What is a Programming Language and Different Types”)

Eg) Python, Java, Ruby, C++

  • Heavily emphasizes abstraction
  • Provides encapsulation (restricting access to specific information of an object) and inheritance (base class’ attributes are inherited by its derived classes)
  • Often uses classes (objects are instances of a class), attributes, and methods

This Brilliant wiki explains it well.

Functional Programming

Control flow is expressed by combining function calls, rather than by assigning values to variables.

(Definition copied from here)

Eg) Java, Python, Swift, PHP, Ruby

  • The power of this paradigm comes from using functions as arguments to functions and also returning functions from functions. Eg) lambdas
  • Codes are much, much shorter.
  • Storing states is discouraged.

Structured Programming

Control flow is defined by nested loops, conditionals, and subroutines.

Procedural Programming

Describes the step-by-step the procedures needed to solve a problem.

The procedural programming language is used to execute a sequence of statements that lead to a result. Typically, this type of programming language uses multiple variables, heavy loops and other elements, which separates them from functional programming languages. Functions of procedural language may control variables, other than function’s value returns. (Article: “What is a Programming Language and Different Types”)

Eg) BASIC, C, Python

These are the first languages that are described as high-level programming languages in history. They were the first to use English vocabulary to describe commands, such as move, load, data.

My Words to You…

Here are the most popular programming paradigms! It is by no means comprehensive.

Below, you could find a few links for further details about these topics.

Resources

Compiled vs. interpreted: guide.freecodecamp.org

Paradigms: www.eecs.ucf.edu, https://www.typesnuses.com/types-of-programming-languages-with-differences/, https://www.freecodecamp.org/news/what-exactly-is-a-programming-paradigm/

OOP: https://brilliant.org/wiki/object-oriented-programming/

--

--

Wen

Studies math, but likes to learn about everything. Wants a degree in philosophy.