Thursday 4 April 2019

Programming. The Next World



If you read these lines, it's because you already know what a computer is. In any case, you know what it's for, and what it looks like. Here, now, we will explain how a computer works and the principles of programming.

This machine contains a lot of electronic components and also some mechanical components, fans, for example, to cool the whole.



You will find very well the screen, the mouse (or trackpad) and the keyboard.

You probably know less about others: it is less and less easy to open a computer to see what's inside. However, even if all the machines do not look exactly like the diagram above, all of them contain the indicated components.

In particular, the motherboard is composed
- of a microprocessor which executes what you ask of it
- of a RAM used by the programs during their executions,
- of several "cards", electronic components charged with a specific task. The graphics card manages the screen displays, the network card access to the Internet, as for the sound card, it's for the sound, of course!,
- and a hard disk that stores the data in the long run.

You can have multiple hard drives, it is safer to save what is on the computer in two different places. Indeed, hard drives do not have an eternal lifespan even if it is 3 to 4 years in general.

"The microprocessor executes what you ask him ..."
Ah, but it's great, you think! Yet, you've never seen a computer prepare your snack ....
In fact, it will only do what it was programmed for. But because they are programmed to do more and more things, some people think that soon computers will be able to do as many things as humans do. This is why we will dwell here on what it means to "program", you will realize for yourself that these people speak more science fiction than reality.



What is computer programming?

What does a computer program mean?

A program is a list of written instructions to solve a problem, or to perform an action.
For example, when you start the computer, a program called operating system begins. It allows to manage the display, and the execution of the other programs.
Then if you want to read a page of Kidisciences on the Internet, you need to open a navigation program, which will manage access to the Kidisciences website and the display of the site. It will communicate with the network card and the graphics card. There are several: Firefox, Safari, etc.
Also, when you want to watch the video at the end of the article, an image processing program and sound will be executed.
The programs are mainly used to manage information, transfer them, usually from the Internet to your screen, transform them and if necessary store them.

The term programming appeared before the first computers came into being, thanks to famous computer theorists Ada Lovelace (1815-1852), Charles Babbage (1791-1871) and Alan Turing (1912-1954) ( more information at the bottom of the article with links to videos and other articles) . Computers have, in fact, been created to run the programs. Better and faster.


Part of the analytical machine of Charles Babbage and Ada Lovelace - ancestor of the computer. Science Museum London
Yes, they are much faster than us and are not prone to computational errors (even adults make miscalculations).

But to design software, you do not have to know how to program. Indeed, a software must be attractive, easy to use and easy to improve and adapt to other functions or new machines. So there is a lot of software design work, not only on the visual aspect but also on all programs to write:
How to break down into several "subprograms"?
Which programs for which functions?
What tests to make sure it's not going to crash?
What data is needed?
Can they be accessed by the user or should they be hidden?
It is about software engineering: it begins with the analysis of the different functions and necessities, then continues with the technical choices to finally finish with the programming.

Rather than programming, we sometimes say coding because programming consists of translating actions into language understood by the computer so that it can execute them.



What is a programming language?


With computers, powerful computing machines, appears another element: the programming language. These are words, a vocabulary and a grammar with which the program is written.
Machines are, as you have seen, only electronic components, they do not understand our language, so we must translate everything.
An instruction from an assembly language program , one of the oldest languages, looks like this:

movb 61,% al
This is a single line of a program that allows for additions.
This language is close to the machine because it is necessary to break down all the actions into very simple, elementary operations, which indicate to the processor exactly what to do. For example, this line of programming means that 61 must be stored at the place named "al".
You can imagine that the following lines are used to store the second number, to add these two values ​​and to store the result of the addition in a different place.
Yes, yes, this language is very technical, but it allows to control as much as possible the calculation of the machine!

The assembler is good for those who know how the computer is built, so they can make the most of it to write more efficient and fast programs. But in general, this language is quite complicated to read. And one of the first programming rules to respect is that you have to be able to read and understand a program that you wrote yourself a few months ago, or a few years ago!
So we created other languages ​​to be able to write complicated programs without getting lost. We have thus separated the source program, written and understood by the men, of the binary program which is the source program automatically translated for the computer. Yes, a program is responsible for translating the source program and managing memory and all those boring or hard-to-know things for the non-experts of the machine architecture.

But this is a long story: a hundred languages ​​have been created, each with its particularities ...: https://en.wikipedia.org/wiki/List_of_languages_of_programming

Pff, it's complicated ...

No, it sounds complicated but it's very simple: a program is a sequence of instructions to follow for example to open a video on the Internet.

A programming language is used to communicate with the computer to execute the program effectively. The same program can be written in different programming languages, but some languages ​​facilitate certain actions or allow better management of complicated data structures.



Computer science = disciplines
We have discussed some of the computer disciplines:
- architecture, which is concerned with the electronic components of the computer,
- networks that manage external connections between computers, especially efficient transmission and security,
- development software, which is the development of successful programs, complex but usable by all.

It is also important to remember that all these disciplines are related. And since we do not find experts in everything, we have to work as a team!





Latest
Next Post

post written by:

0 comments: