Introduction to programming - What is Program? - basic concepts - 01

- Andrés Cruz

En español
Introduction to programming - What is Program? - basic concepts - 01

The first thing I am going to explain in these sections about basic programming would be that it is a program; you can watch a program as if it were a cooking recipe to prepare, for example, a cake that goes from its ingredients, through the process of creating the mixture to cooking it; In a computer program we have the same elements; therefore.

A program allows:

  1. Data Entry: Collects input data for processing. For example, through the keyboard or mouse.
  2. Processing: The program uses the input information to perform the operations that have been programmed for it.
  3. Output: The program returns the result obtained after processing the data.

In our specific case of web development it could be like the following examples:

  1. (Data entry) Our user enters through the web browser.
  2. (Processing) The program processes what in this example is the input source, the URL to know exactly what our user wants to see.
  3. (Output) The program returns a page that is bound to the previous path.

Another example would be; If we have the following form:

  1. (Data Entry) Our user enters the data in the form.
  2. (Processing) The program processes the URL to know what request our user is sending and to know through the URL or route which function we have to call, that is, to know exactly what it has to do, since you can take as a reference that the form above is tied to a function, which describes other steps or processes to do something with the data that our user is receiving; which could be for example:
    1. Create or update a resource, such as a post
      Filter a list, and a long etc.
    2. (Output) Finally, the program returns the information requested through the browser.

A practical example of a function that receives a request from our user through a form would be like the following:

def procesar_form():
     form = InvoiceForm()
     if form.errors:
        return render_template('errores.html')
     post = Post()
     post.title = request.form['title']
     post.description = request.form['description']
  return render_template('exito.html')

Previous code panning

In which we see a process of how we can receive a request that our user sends from the browser, in our previous examples, this would be the function that is responsible for processing our user's request; It goes from obtaining a reference to the form that our user sent, through verifying if it is valid. Show an error page in case errors exist; in this case, this error page would be the output of the program, the rest explained would simply be the processing level.

Then, if there are no errors, the process follows in which we simply create an entity, which can be anything, a contact, a stronghold or in this case, for example, a post that we then save in the database and finally output a document. in HTML to our user.

In short, what is a program?

A program is simply a set of code instructions, which are written in some programming language and which performs a particular task.

Generally, programs usually have a graphical interface or UI, where the user can interact with the program, but there are also programs based on command lines.

Programs today not only work on a computer with Windows, MacOS, Linux... if we do not have a wide range of technological elements that can run programs; such as smartphones or not with Android, iOS, tablets, watches, televisions, video game consoles... in general, EVERY technological device that allows the user to interact with it digitally, has a program or set of programs for this purpose. .

A common characteristic that programs have is that in order to be executed and therefore be able to use them, they must be "loaded in memory", this term refers to the fact that the program has to be in RAM memory, which is the VOLATILE memory of On our computer, EVERY program that is running in the Operating System (OS) is "in memory" RAM.

Remember that in the courses section we have the complete course in which you will find more material like this.

The next thing we are going to deal with would be: about programming languages

Andrés Cruz

Desarrollo con Laravel, Django, Flask, CodeIgniter, HTML5, CSS3, MySQL, JavaScript, Vue, Android, iOS, Flutter

Andrés Cruz en Udemy

Acepto recibir anuncios de interes sobre este Blog.