Where to start learning programming?
How to learn the art of computer programming? And programming is an art! How to make a complex machine execute your commands? How to understand all the many programming languages?
Where to begin? What to pay special attention to? From the abundance of information on this issue dizzy. Do not despair, I will help you. Many programming languages have been invented, and many are no longer relevant. There is no need to learn all languages, it is important to choose a language for your tasks. All these languages have in common – they don’t speak them, they write programs. A program is a sequence of statements.
When the program starts, the operators begin to execute in the order provided by the algorithm. The interpreter performs them, translating into the language of machine codes. It is possible that at startup the program is processed by the compiler, only by translating and creating a file that is capable of working autonomously. The interpreter, like the compiler, is a software environment that allows you to create, debug, and run your programs. I advise you to start with the BASIC language, and not with the visualized versions of this product, but with the simplest DOS interpreter. BASIC is the simplest programming language designed specifically for training. Learn simple language operators in BASIC their minimum. In addition to the operators of input and output of information, in any programming language, as in BASIC, there are loop operators, conditional operators and assignment operator, as well as the possibility of calling a subprogram. Let’s try to understand the terms. BASIC (except that it is an abbreviation of Beginner’s All-purpose Symbolic Instruction Code – a universal code for symbolic instructions for beginners) is translated from English as “Basic”. This means that only fundamental constructs are present in the language. An operator is a special language construct that allows you to perform an action. The language also contains variables and constants. Constants are numeric and string. Numeric constants are simply numbers: 1; 5.34; -0.99 and so on. String constants are some words enclosed in quotation marks, for example: “BASIC is a simple language!” Or “I like to program”. Language variables are memory cells in which constants are stored. Consider the simplest of the operators, the assignment operator: A = 0. Here A is a variable, = is the assignment operator, it puts the number 0 in cell A. Or Pi = 3.14, now we have assigned the value Pi to 3.14. We do the same with string variables: B $ = “Hello.” B $ is a string variable, the $ sign indicates this. Consider the loop operator: FOR I = 1 TO 10 [set of statements] NEXT This construction allows you to execute a set of statements enclosed between the words FOR and NEXT 10 times, and in each cycle the variable I will be equal to the number of the cycle, namely from 1 to 10. The boundaries of the loop can be arbitrary. The conditional statement looks like this: IF A> 0 THEN [statement-1] ELSE [statement-2] That is, if the condition entered between IF and THEN is true, then statement 1 is executed, otherwise, statement 2. The subroutine is part main program, which can be called from the main program, more than once. This is done as follows: [label] [Set of statements] RETURN This is a description of the subroutine, the RETURN statement indicates that the subroutine is finished, and the computer should return to the dial peer. The call is made as follows: GOSUB [label] After the computer encounters the GOSUB operator, it will proceed to execute a set of statements concluded between [label] and RETURN.
There is another case where the operators are executed in the wrong order in which they are written: the GOTO [label] operator tells the computer which operator to switch to. After starting the program, the interpreter, unlike the compiler, will start executing the operators in the order specified by the algorithm. If he encounters an error, he will inform you about it. Unlike the interpreter, the compiler checks the program for errors in advance and creates an executable file. The advantage of the interpreter is simplicity, and the compiler is that after successful compilation it is no longer needed. The operating system can itself execute such files.