Programming Paradigm — Onload Code
In this article, we are discussing programming paradigms regarding System design and architecture.
This is the second article on the System Design and Software Architecture series.
Introduction to System Design and Architecture — Onload Code
This article is the first article on the System Design and Software Architecture series. In this article, we are…
What is Programming Paradigm?
Programming Paradigm is an approach to problem-solving using a programming language. We can also say that it is a problem-solving method using the tools and techniques available to us by following a specific approach. Since there are so many programming languages, you should follow some strategies when they implement. And this process is named as paradigms. In this article, we are going to discuss the types of programming paradigms.
Types of Programming Demonstration
1. Imperative programming paradigm
The ideal consists of several statements, all of which store the result after execution. It involves writing a list of instructions to tell the computer what to do step by step.
In an essential programming parameter, the sequence of steps is essential, because when a step is executed, a given step has different consequences based on the current values of the variables.
- Demonstration of procedural programming
- The Procedure Program (which is also essential) allows those instructions to be subdivided into procedures.
- Procedures are not functions. The difference between the two is that functions provide value and procedures do not. More specifically, functions are designed to have minimal side effects and always produce the same output when the same input is provided. Procedures, on the other hand, have no benefit value. Their primary purpose is to perform a given task and cause the desired side effects.
- An excellent example of a cryptocurrency is a well-known fact for loops. The primary purpose of for loop is to cause side effects, and it does not provide value.
- Features of the procedure code
- Procedural programming is excellent for general task programs.
- With coded simplicity and ease of implementation for compilers and converters
- Large books and online course courses available on the tested algorithm make learning the material easy.
- The source code is portable.
- The code could reuse in different parts of the program without the need to copy it.
- The program stream is easy to find, as it has a top-down approach.
2. Object-oriented programming model
OOP is the most popular programming model because of its unique advantages, such as the modularity of the code. And the ability to directly link real-world business issues in terms of code.
Critical features of object-oriented programming include class, abstraction, encapsulation, inheritance, and multimeter.
A class is a mould or plan that creates objects.
Objects are instances of classes. Objects have properties/conditions and methods/behaviours. Properties are data related to the object, and methods are the actions/functions that the object can perform.
Abstraction separates the interface by activating the summary. Encapsulation is the process of hiding the internal activation of an object.
Inheritance is a fundamental concept in object-oriented programming (OOP) languages. It is a mechanism by which you can get a class from another class, and it shares a set of attributes and methods for a hierarchy of classes. It explains how class hierarchies support the reuse of code readability and functionality.
Polymorphism is an object-oriented programming concept that refers to the ability of a variable, function, or object to take different forms.
Programming languages with OO model implemented: Ruby, Java, C ++, Python, Simula (first OOP language)
3. Parallel processing approach
Let see what is parallel processing. Parallel processing is the division of program instructions into multiple processors.
A parallel processing system allows you to run a program in less time by splitting it into multiple processors.
Languages that support parallel processing access:
- NESL (oldest)
- C ++
4. Declarative programming paradigm
Expression programming is a style of building programming that expresses logic without talking about the control flow of calculations.
Publishing programming is a programming parameter that defines what a programmer should accomplish without defining how it should be implemented. In other words, the approach focuses on what needs to be achieved rather than advising on how to achieve it.
In the situation of the union, think of the President expressing his intentions for what he wants to happen. On the other hand, essential programming would be like McDonald’s voter manager. They are very essential, and as a result, it makes everything meaningful. So, they tell everyone how to do everything from simple actions.
So the main difference is that the essential thing is how you do something and the statement tells you what to do.
5. Logical programming model
The logical programming model takes a publishing approach to problem-solving. It is based on formal logic.
The logical programming model is not made up of instructions — instead, it is made up of facts and clauses. It uses everything it knows and tries to come up with a world where all those facts and statements are actual. This can use to express knowledge without relying on execution, and programs are more flexible, compressed, and understandable.
It enables the separation of knowledge using, that is, the configuration of machines, without changing programs or the code beneath them. It can modify and expand in natural ways to support specialized knowledge, such as the advanced level meta-level.
And also it can use for non-computer subjects that rely on logical and accurate means of expression.
6. Functional Programming Paradigm
The functional programming parameter has its roots in mathematics and is independent of language. The main principle of this idea is to implement a series of mathematical functions.
You write your program on short tasks. All codes are in a function. All variables are in the range of the function.
In the functional programming parameter, functions do not change any value outside the scope of that function, and those functions do not affect any value outside their scope.
Clean Tasks — If the input array, the output will be a new array, and the input array will not change. Therefore in a pure function, the output depends only on the input.
Repetition — A repetitive function is a function that calls itself when it is executed. This allows the function to be repeated several times, with the result being output at each stop process.
Reference Transparency — this can replace an expression with its corresponding value without changing the behaviour of the program. As a result, estimating a transparent function gives the same value for static arguments.
Variables cannot change — in functional programming, you cannot change a variable after it has been started. You can create new variables, and this will help maintain the status of the program throughout its run.
7. Database Processing Access
This programming system is based on data and its movement. Program statements are defined by data rather than hard coding of a series of steps.
According to Oracle, A database is usually a collection of structured information or data stored electronically in a computer system. A database is usually managed by a database management system.
Database tables use to process as well as to query data. Data can then easily access, managed, modified, updated, and controlled.
A right database processing approach is essential for any company or organization. This is because of the database stores relevant information about the company, such as employee reports, transaction reports, and salary details.
Many databases use Structured Query Language (SQL) for writing and querying data.
Thanks for reading the article programming paradigms regarding System design and architecture.
Originally published at https://onloadcode.com on December 13, 2020.