Seidor
hombre de pie usando un ordenador

June 05, 2024

What is POO and why is it so important?

In the world of web development, Object-Oriented Programming (OOP) is a concept that is often
heard, and in fact, any professional programmer knows what it is and is possibly developing projects
with this methodology.

But, what is it?

POO is a programming paradigm that innovates the way a project is carried out and focuses
on making the development process more understandable and scalable. The intention is to bring programming closer to
how we would express things in real life.
Let's take an example to make it more understandable: If real life were a program and we were all 'objects',
a person would be an object of the human class (mold). This person would have properties (eye color, height,
hair color, etc.) and methods (walk, run, jump, talk, etc.).

Classes

Normally, object-oriented programming starts by creating a class; the place where we will define the
structure of the elements that will be common to the objects. As we mentioned before, the class functions as
a mold that shapes the objects instantiated from it.
The class is the main entity, in it we indicate what the attributes or properties and methods will be that all
variables of that type will have.

programacion

Properties

Properties are the values or characteristics that the class has. Properties will allow us to store
specific values that can be modified if desired, but they are not capable of executing an algorithm or
calculation for the return.
It is common for a class to have initial properties (which will be set from the constructor of the class in
question) so that when an object is created, the main properties of it are directly specified from the very beginning.
Properties can be modified externally because by default they are public (from new versions
of Javascript, a private property can be added by adding a ‘#’ at the beginning of its name).

Methods

Methods are functions in our class that can have parameters. They are used when
we want to obtain a result from an algorithm, calculation, external request, etc.
As with common functions, the parameters we send to the method will allow us to customize
the algorithm that it will perform internally and be able to receive a different return value
depending on the parameter value.
Methods are usually named as verbs because they are actions that can be executed from a
class.

Instantiate

The way an instantiated object of a class will be created is as follows:

programación con fondo negro

Maybe it might interest you

June 05, 2024

How to combine fonts correctly

There are many ways to combine typefaces, some more useful than others, however, the ideal place to start is to understand the role that each typeface has and focus on the qualities it possesses.

SEIDOR
June 05, 2024

Free alternatives to Google Adwords Keyword Planner

A key point in SEO is Keyword Research, that is, the search for keywords. We show you three free alternatives.

SEIDOR