Definition of

Source code

Text lines

A source code is a series of lines of text.

Source code is the group of lines of text written in a certain programming language that tell a computer how to execute a computer program. In order for the machine to interpret it, it is necessary to translate it through an interpreter , a compiler or another tool.

Before moving forward with the definition of source code , it is important to analyze the terms that make up the expression. A code combines characters such as numbers and letters that have value within a certain system. The idea of ​​source , meanwhile, refers in this framework to the origin or support of something.

The source code, in this way, is developed by a programmer in a language that is readable to people for the purpose of providing instructions to a computer. This source code is then converted to machine language so that the device hardware can effectively execute the command.

How the source code works

The person who writes the source code of a software is a programmer or a software engineering expert. This specialist uses a programming language to create the corresponding instructions, which are recorded in this source code and stored as a file .

Once the source code is written, that information can be processed in different ways depending on the need. At this point different types of programs appear, such as interpreters , compilers and assemblers .

Interpreters translate instructions step by step according to requirements and generally do not store the result of their intervention. Compilers , meanwhile, are responsible for translating the source code into a different language, producing the so-called object code . The assemblers , finally, proceed to translate the source code prepared in an assembly language to an object code with machine language.

programming languages

Programming languages ​​are classified as formal languages . This means that they use primitive symbols, which are linked to each other through rules that are formally specified.

Using a programming language, a human being can write commands as algorithms to control the operation of a computer or a computer system, instructing it to execute various tasks. The source code, in this way, is a collection of lines of text created with a programming language.

What is meant by a computer program is a set of instructions developed with a programming language. Each program, therefore, has its source code.

When the programming language serves to give instructions that directly control the hardware, being conditioned by the physical components, it is classified as a low-level language . A high-level language , on the other hand, makes it possible to express algorithms appropriately so that they are readable to humans.

Computer program

There are multiple programming languages ​​that can be used to write source code.

Various paradigms

Programming languages ​​can be classified in different ways according to their characteristics. This classification gives rise to various paradigms .

Object-oriented programming , for example, is based on the notion of an object. An object is an entity with data organized as fields and encoded using methods.

In event programming , the structure and execution of the program are determined from events that take place in the system. The user is responsible for these events.

Functional programming , imperative programming , declarative programming , structured programming , concurrent programming , and modular programming are other programming paradigms.

Source code debugging

Debugging the source code is essential to correct any programming errors . To carry out this process, you need a debugger .

Various kinds of errors can be made when programming. Arithmetic problems, typos, infinite loops, and syntax errors can cause software to malfunction .

A debugger, in this way, is a program whose function is to detect programming errors. The programmer can use this tool to easily identify problems and correct them in a simple way, carrying out the process called debugging .

Debuggers, in short, make it possible to optimize the source code . What they do is find anomalies using different techniques, contributing to the application of the necessary corrections.

Instructions

A debugger helps detect errors in the source code.

The importance of libraries

To make it easier to write source code, programmers can use a library . Also called libraries, these are already compiled instructions that can be used in different programs.

The same library can thus be used in more than one software. It can be said that each library is made up of a series of codes that provide common functions already developed and tested by other programmers.

It should be considered that a library is not a computer program: that is, it cannot be executed autonomously, but rather has to be used by other programs.

The source code and licenses of the software

The software may be distributed under different types of licenses. A license is understood to be the contract that the owner of the rights to the program (the licensor ) establishes with the user (the licensee ).

Generally, the source code is not available to the user, who therefore cannot modify it. However, in the case of open source licensed software , the source code can be altered and then freely redistributed.

The idea of ​​open source is that the source code in question can be enriched with the contributions of many people. With this methodology, development is collaborative . Typically, the result of this collective work is available to people in general through the Internet .

Open source software should not be confused with free software . That the source code can be freely modified is usually associated with an expansion of community participation, motivated by ethical or practical reasons. Software with a closed source license can, however, be distributed without the user having to pay.