ComputersProgramming

The variable in programming is completely characterized by what?

In programming, a well-described task does not always mean solving it. But any description of the problem always brings it closer to its solution. Algorithmization and programming in recent years are already with great stretch are considered to be synonyms.

Programmers are increasingly called developers. The result of programming is always a description (variables + algorithm) of the solution of the problem.

In what language what and how is done - it does not matter.

A bit touching story

Algorithmization and programming at first went hand in hand, but then their paths parted. At this point, much to remember is not worth it - this concerns the first. About variables and algorithms you always need to have a clear idea - this applies to the second.

The advantage of modern programming is largely due to the thorny path through which information was understood, the description of data and algorithms for their processing in programs.

The first languages were simple as punch cards, but they worked. Variables, types of variables, declaration of variables and the order of description were most strictly regulated.

As a rule, variables were divided into dynamic (those that can be changed) and static (constants, they can not be changed).

The first was a variable of the pointer type (it is the merit of the best and "eternal" language - "Assembler"). Not all languages have been preserved at different times, but in modern programming the use of pointers is the top of code perfection.

Basic rules: how it all began

The variable must be described before the first use, and most often at the very beginning of the program, and even more often in a specific section of the program. The variable must be written in Latin, with or without numbers. Some languages allowed the symbol "_". The first must be a symbol.

The variable had a characteristic feature: it should have known how much it took a byte to remember and how to align it to the word boundary, or even a double word.

The latter was very important for mathematical programs. The features of the organization of the operative memory and the work of the mathematical coprocessor obliged the programmer not only to correctly and timely describe the variable, but also to think about how it will fit into the operative memory.

Note. The "core" of RAM is inaccessible to modern programming in the vast majority of cases. Previously, the organization of memory had to be strictly considered.

The first data structures - the sets of variables - functioned as variables with a certain semantics, but to access them it was required not only to know how many bytes that takes, but also to take into account that some types of data the compiler automatically aligned on the word boundary.

All this led to serious mistakes in the programs. In memory of those harsh times, it should be noted that the first languages, with all their punctuality and exactingness, provided variables, types, data structures in programming and development with secure syntactic control.

If the program passed the syntactic control and successfully linked, the execution problems started only with a fatal programmer error or hardware failure.

Our time, Internet programming

Some programming languages have remained committed to strict description of variables. The majority allows a description, but allows you to change the type of the variable as convenient for the programmer.

PHP: here the variable in programming is completely characterized by a name, value, but the type depends on the place in the code and the time when it was needed. Some people do not like to name variables with the sign "$", but you can have such names: $ 1, $ 2, $ 3.

Ranges of values exceed the required limits, and there are many possible types. For the vast majority of tasks, there are enough lines, integers, sometimes real and logical. There is no pointer as such, but there is the possibility to pass an indication to the place of the variable.

JavaScript: The variable in programming is completely characterized by the fact that it must be described, although in some cases the language will forgive the lack of a description, the chances of getting valid code will be small. JavaScript just will not work with something that does not fit into its syntax or it could not execute.

Ranges of values are also off scale, but the most popular are the string variables.

Programming in languages related to the Internet indirectly, that is C #, C ++, Pascal, Delphi - strict. In C #, you need to not only describe, but also initialize.

What are the variables

First of all, its name, to which different languages make strict demands. If in PHP the $ sign necessarily precedes the variable name, then in Java this is beyond the scope of the convention. In general, in terms of naming variables, in addition to the ideas of the syntax of the language, there are a lot of ideas for developers.

Starting to write in a specific language, one should listen to the opinions of colleagues and see the latest ideological manuals in the style of the language.

The second characteristic of a variable is its value. It is always there. Even if there is no value, this is also a value. A characteristic feature: for example, PHP, many functions that issue a number as a result can produce a result of boolean - what is not the result?

Type is not important, availability is important, and many JavaScript JavaScript constructs are satisfied by the presence of the value, regardless of its type.

The last thing that matters is, in fact, the value of the variable.

Basic data types

In general, the world of description, the world of variables, despite the dialects and styles in the naming, has not developed much with respect to the basic types.

In general, programmers use strings (string), often integers (int, integer), if necessary, real numbers (double, real), some still retain the notion of a character (char).

About the database (from small to large) you can not even tell, there the number of variations of the main types is provided for all occasions, and many types of data are inherited from the times of Ada and Babbage.

Currently, the very best variable in programming is completely characterized by pointing to oneself, assuming that its meaning, type and generally who it is will be clear only when it is needed.

Variables and Algorithms

The lonely variable in programming is completely characterized by the desire to be in the company of its kind. This is a historical phenomenon, and little depends on the will of the developer.

If the creation of the program begins with a technical assignment, especially if the specialists are taking part in the development, for which the first word has more meaning in the topic "algorithmization and programming" than the second, then there will be a great number of variables. Typically, this option stops at the stage of describing variables.

If the creation of the program begins with an analysis of its main task, and it is the main point of the task that is taken as a basis, then the chances of obtaining a working result are sufficient.

To describe the main point and create an algorithm serving it is not just a variable in programming, type, name, values and place of description, but the beginning of the process. The process of describing variables and the algorithm that works with them is important.

Important movement:

  • The first approach to the goal;
  • Result, analysis and specification of the description;
  • The second approach to the goal.

Usually, after the creation of the second-third description comes an understanding of where to start. And the task went to work.

A concise description of variables

It is not enough to start the program with the main variables: not names, types and values play a major role. A single variable, a data structure, an array, and even an object is simply a statistical solution of the problem.

A tree of objects describing the task, that is, variables and algorithms encapsulated in a single code - an object, and all objects into a common object - a system of objects - this is the case. This is a real and modern creation of variables.

Such variables can interact with their own kind, and thanks to inheritance each of them can move along its pedigree branch, that is, a pointer to what is used and where it is currently used, and how it does it is actual, and its content itself is not. In this case, the content plays a role, when it does, the pointer moves to the next content.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 en.unansea.com. Theme powered by WordPress.