The term event It comes from the Latin eventus and, according to the dictionary of the Royal Spanish Academy (RAE) , has three great uses. In several countries Latin Americans, an event is a important event that is scheduled . This event can be social, artistic or sports. For example: “Tonight's event will face the two best teams in the tournament”, “Next month three events will be held at the Law School”, “The Rolling Stones concert has been the most popular event of the year”, “There are no tickets left for Friday's poetry event”.
This use of the concept contradicts, in a certain way, the meaning of the event that refers to something unforeseen or that may occur even if there is no security about. A eventuality it is something that goes beyond the limits of the planned; An event like those mentioned above, however, must be scheduled in advance.
The third use of the term encompasses both meanings: an event is a occurrence , one thing that happens. From this perspective, the event can be planned ("Everything has to be ready for tomorrow's event") or appear unexpectedly (“An event came up and I couldn't attend the meeting”).
For the science, an event is a phenomenon (an observable event at a given time) or a event that occurs at a certain position and time (therefore, it can be specified as a point in spacetime).
In mathematics, it is known as statistical event to the subset of a sample space. These are the possible results that can be obtained from a experiment random.
For the computing, an event is an action that is detected by a program; This, in turn, can make use of it or ignore it. In general, an application has one or more threads dedicated to attend the different events that are presented to it. Among the most common sources of events are user actions with the keyboard or mouse. It should be mentioned that any program has the power to trigger its own events, such as communicating to the system that it has completed a particular function.
It is called event driven program to the one who changes his behavior in response to the events that take place during its execution. These are generally used when there are a number of activities outside the computer that must be registered, which are performed asynchronously to the life of the application. The event is, first, detected by the system; the program in question will receive it only when it is ready, and then it will analyze it and see if it has any use for it.
In video games, there are a series of actions that take place independently of the player's intervention, which are combined with the events triggered by the latter to complete the experience. In the mythical TetrisFor example, the pieces fall through the center of the game space until the user presses one of the arrow keys to change their course. In addition, it is possible to rotate them, depending on the version, in one direction or another. Simply put, the flow The game does not depend on the events, but these affect the outcome.
With regard to the design of the code of a program that accepts events, it is important to keep in mind that it will not always be possible to react to the event at the exact moment of its appearance; for this reason, you can register it and decide if it will be used later. An example, again in the field of games: the main character is falling from a platform and the player presses the jump button; developers can decide to save this data to make the hero jump once he touches the ground, or discard the event for lack of consistency with the situation.