Nerd For Tech
Published in

Nerd For Tech

A brief study case of Programming Paradigms

Before any further explanation on how programming paradigms work, I need to set clear that these concepts are kind of difficult to digest on a first run, so, be patient in trying to understand the main foundations of a paradigm before getting into more detail and technical stuff.

A paradigm, in general terms, does not have any relation with technology itself but is a way to solve problems, as a matter of fact, we need to have a problem (strictly) just to apply a paradigm, so, simple.

A way to solve problems = Paradigm.

Of course, you will have (in most cases) tons of answers for a specific problem, this will depend directly on a solving logic for that problem, which luckily tends to be a similar answer for the bunch of possible working scenarios. By having common answers we can experiment with solutions that can fit most of those working scenarios and perform paradigms or create a new one (Not easy!).

So, let’s recap a bit.

  1. We need a problem for a paradigm existence (and appliance).

In computer science, we also find and solve solutions using software, hardware, databases, etc. The goal is targetting the best suitable answer for business, academic, and other whatever solution(s) ahead, not every solution is 100% correct and of course may change on time.

For new developers, the Structured Paradigm is the first concept to learn and their first way of resolving problems with code, and it's okay. The most used paradigm in the software industry is without a doubt is the Object-Oriented Paradigm. The difference between both paradigms is HUGE! But with time, that concepts will fit nicely.

I will explain the most common paradigms later. There’s a lot of them. But, before start studying each paradigm we need to set clear that in order to work on a solution, a Programming Paradigm sets the foundations on choosing the right programming language, having a solid programming base, knowing pros and cons, and most important, determining profitable tech for the software solution.

Getting deeper with Programming Paradigms.

Technology changes daily, we need to understand those changes if we want to stay relevant on time. My formal definition of a Programming Paradigm focuses on a group of techniques and concepts applied to solve a programming problem.

Since the C language conception, multiple concepts changed for handling and solving complex software. 10, 20 years ago the spaghetti code was the best approach for solving problems on code. The breakthrough of this was the adoption of the OOP, with the birth of the classes, methods, attributes, etc.

Just like I said before, there’s a lot of paradigms, around 800 of them. But the top 4 (and the most used, actually!) are the following:

  1. Structured Programming (for newbies)

You can apply multiple paradigms for one software project, there’s no rule for this, actually, if it works great and fits the solution, then you have the correct approach for that specific problem.

The first one: The Structured Paradigm

This paradigm is the most known because represents the first main skills of a software developer. This also is considered the first paradigm of the modern era.

Every person who wants to learn to program starts by developing simple algorithms, where tasks are runs sequentially, it also features selective operations (boolean results) and looping operations (iterations). That 3 characteristics are the foundation for the software of today.

Structured programs have easy comprehension, you can divide code into modules and in operations.

There’s nothing much to talk about, the programming scripts focused on this kind of paradigm can be executed any time, usually, have one or more entry and return statements. If you want to start doing your first steps on programming, this is the Paradigm for you.

A great thing about Structural Programming is that is supported by almost any programming language, but once you have more experience you will discover that can be a misconception on primitive variables and Objects (really?), languages like Python are multi-paradigm, handle variables as objects from OOP, but also can handle loop cycles, methods, etc.

What can be wrong with this paradigm? If there’s a complex problem, the size of the solution goes big, this can lead to something hard to maintain, with hard logic lack and no practicality at all.

Always think of the size of your application, maybe you need something else more than Structural Programming.

The most used: Object-Oriented Paradigm

When you as a developer fully comprehend this paradigm, you become a badass programmer. The learning curve is hard, it takes time, but worth it.

This paradigm came to solve code repetition, the strong Achilles ankle of the Structured Paradigm, and basically describes two main elements, the Object, and the Class

An Object defines everything in programming, sorry, in the World actually.

For this Paradigm, everything is an object, the main goal of this is that you need to describe an Object before creating it, it is possible to describe it, it can be programmed. This concept is (in my opinion) an abstraction of reality.

On the other hand, the Class represents the Object definition (it's like a template) when can define parts, such as attributes, methods, and another kind of intended behavior.

For this, let’s set a statement, if there’s not Class, there’s not Object

In computer terms, when an Object is created a memory space is reserved for interaction. The customization of an Object will rely on the attributes added to that object by the time it is initialized.

Initialized is the way that an Object lives on memory. By the wrong use of the memory the program will lead to disaster, so, the Object creation should be responsible as needed.

There are also other significant characteristics that help the OOP expand functionality in a very efficient way. Terms like Inheritance and Polymorphism can copy values from other Classes and adopt multiple faces with practical actions.

Some languages let the Inheritance be done in multiple and simple ways, saving code lines and execution time. The pro facts of the Polymorphism rely on expanding the Object logic to satisfy the programmatic problem.

In general terms, the advantages of using OOP are Reusability, Hierarchy handling, easy maintenance, and the ability to combine other paradigms inside of it. In my personal experience, this paradigm is very challenging for complex rule-based systems.

The Internet Paradigm: Web Paradigm

This paradigm grows very quickly for obvious reasons, the Internet usage and the constant improvement of Web technologies (probably mobile too) and their business adoptions on personal projects, companies, or even Startups.

The key to understanding is the Client-Server principle.

The Server handles and contains Databases, User Management logic, any possible CMS implementation, or any other resource used for whatever purpose which sets the bar on complexity when the solution requires additional features.

The Client is the way to interact with the Server information, we have mobile, desktop, and browser clients, and a bunch of different models, specifications, and types of consuming data.

Being a professional Web Developer requires a lot of knowledge because there’s a lot of tools and roles (yes, roles) for generate solutions. Look, we have frontend developers, backend developers, DevOps, DB Administrators, SysAdmins, UX/UI Designers … This is big for one person, that’s why companies form groups or divisions focused on certain activities for delivering the best quality product possible.

The technologies behind this are HTML (the Markup language) or what the browser understands, CSS for styling, JavaScript (basically for transitions and interactivity), and of course, whatever programming language that handles Web Development (PHP, JAVA, Ruby, Python, Net Framework).

The new way of solving problems: Functional Paradigm

I don’t have many experiences with this particular paradigm, but on my understanding, the foundations of this come from the Lambda calculations, this is strongly linked to Mathematics.

For this time, the variables are stateless and all is structured by expressions evaluated as functions, it is like programming without using loops (no for, no whiles, no do-whiles) based on the conversion and the reduction principles, this particularity makes the functions first-class citizens (on implementation).

Another great thing from this is the resources management, when a variable becomes inaccessible is released from memory.

This paradigm is applicable for quite specific solutions, as a matter of fact, this represents and still being a challenge for quite solutions out there. With the high adoption of the IA, the Functional Paradigm maintains certain relevancy but actually can be found on Research projects, voice recognition, Telecom system, and IA of course.

This can be developed by programming languages like Python, Java, or even PHP.

What can we conclude about it?

We can make various conclusions about what to do and what to expect in software.

  1. There’s no best programming language, at all, there are best languages designed for certain problems. You can learn multiple languages and be proficient in them.

Understand these four paradigms today, try to find a niche, read more about it, once you get it to apply it to a personal project o a specific software requirement.

Happy coding :)

--

--

NFT is an Educational Media House. Our mission is to bring the invaluable knowledge and experiences of experts from all over the world to the novice. To know more about us, visit https://www.nerdfortech.org/.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store