The programmer's approach
The purpose of this post is to teach you how to think and think like a programmer analyst.
This way of thinking combines complex intellectual processes similar to those accomplished by mathematicians, engineers and scientists.
Like the mathematician, the analyst-programmer uses formal languages to describe reasoning (or algorithms). Like the engineer, he designs devices, he assembles components to realize mechanisms and it evaluates their performance. Like the scientist, he observes the behavior of complex systems, he sketches explanatory hypotheses, he tests predictions.
This is a high-level skill, which involves various skills and knowledge to be able to (re) formulate a problem in several different ways, to be able to to imagine innovative and effective solutions, to be able to express these solutions clear and complete.
The programming of a computer is indeed to "explain" in detail to a machine that that she must do, knowing from the outset that she can not truly "understand" a language human, but only perform automatic processing on sequences of characters.
A program is nothing more than a sequence of instructions, encoded respecting very strict set of conventions set in advance that is called a computer language. The machine is thus provided with a mechanism which decodes these instructions by associating with every "word" of the language a precise action.
So you will learn to program, activity already interesting in itself because it helps develop your intelligence. But you will also have to use the programming to achieve concrete projects, which will certainly give you great satisfaction.
Machine language, programming language
Strictly speaking, a computer is nothing more than a machine performing operations simple sequences of electrical signals, which are packaged in such a way that they can not be take only two states (for example a maximum or minimum electrical potential). These signal sequences follow a logic of the "all or nothing" type and can therefore to be considered conventionally as series of numbers never taking two values 0 and 1. A numerical system thus limited to two digits is called a binary system.
Know now that in its inner workings, a computer is completely incapable to treat something other than binary numbers. Any information of another type must be converted, or coded, into binary format. This is true not only for the data that we wants to process (texts, images, sounds, numbers, etc.), but also for programs, that is to say the sequences of instructions that we will provide to the machine to tell him what she has to do with these data.
The only "language" that the computer can truly "understand" is therefore very far from what we use ourselves. It's a long series of 1's and 0's (the "bits") often treated in groups of 8 (the "bytes"), 16, 32, or even 64. This "machine language" is obviously almost incomprehensible to us. To "talk" to a computer, we will need to use automatic translation systems, capable of converting character sequences into binary numbers forming keywords (English in general) that will be more meaningful to us.
These machine translation systems will be established on the basis of a whole series of conventions, of which there will obviously be many variants.
The actual translation system will be called interpreter or compiler, depending on the method used to perform the translation. We will call programming language a set of keywords (arbitrarily chosen) associated with a very pre-set set of rules indicate how these words can be put together to form "sentences" that the the compiler can translate into machine language (binary).
According to its level of abstraction, we can say of a language that it is "low level" (ex: Assemble) or "high level" (ex: Pascal, Perl, Smalltalk, Clarion, Lisp ...). A low level language consists of very basic instructions, very "close to the machine". A language of high level has more abstract or more "powerful" instructions. This means that each of these instructions can be translated by the interpreter or compiler into a large number basic machine instructions.
The language I will post first is Python. This is a high level language, whose translation into binary codes is complex and therefore always takes a certain amount of time. it could seem a disadvantage. In fact, the benefits of high-level languages are huge: it is much easier to write a program in a high-level language ; the writing of the program therefore takes much less time; the probability of doing faults is significantly lower; maintenance (that is, the provision of further modifications the search for errors (the "bugs") are greatly facilitated. In addition, a program written in a high-level language will often be portable, that is to say that we can operate with little change on machines or operating systems different. A program written in a low-level language can never work only on one type of machine: for another to accept it, it must be rewritten entirely.