AI and Cyber: what programming skills are needed?

(To Simone Cossu*)
19/03/24

As trivial as it may seem, the programming was born in response to the request to have machines perform tasks: humans needed a simple interface to talk to them.

Initially, we had to adapt a lot using their language (it was the time of punch cards). Over time, Messrs. Kernighan and Richie arrived who, with their "C", simplified the writing of the code, making everything possible for an increasingly wider audience.

What "language"

Un programming language it is not easy to choose: the process for choosing it is very similar to the one we implement when we choose an item of clothing, it must be comfortable and, in some way, it must reflect us. Furthermore, it must adapt to the circumstance in which we would like to wear it. Similarly, each programming language has its own characteristics and must allow us to write the code necessary for our final purpose, in the simplest and most effective way possible.

Python

Python represents an excellent compromise between different needs. Quite easy to learn, due to its very English-oriented syntax, it is also very expandable. On average fast in code execution, it is at the same time portable from one architecture to another.

What is Python

Python is a high-level object-oriented programming language. It adapts very well to different uses, ranging from small ones script (small programs that respond to simple automation needs) up to large applications (for example, web ones).

It is an "interpreted" language, meaning the code is read and executed on the fly by the compiler, one line after another. This could bring it closer to equally well-known languages ​​such as javascript e PHP. However his ability to create the bytecode, similarly instead to Java, allows him a sort of compilation of the written code, closer to that of the machine but not exactly compiled. Enough to allow an improvement in overall execution performance.

How to study Python

The study of Python does not present any particular critical issues, on the contrary it was developed to force the syntax with rules that are as simple as they are effective. However, the differences are not trivial.

When switching to Python you have to forget about line terminators (the infamous ";"), brackets to describe blocks of code, and perhaps even struggle a little with the rigid syntax based on spaces in the same number as the beginning of the lines of a block. As an example, an IF block in a C-like language would be expressed as follows: if ( condition ) { code to execute } else { other code to execute } while Python expresses it as if condition: code to execute else: else code to execute. The two spaces at the beginning of the line determine whether the lines belong to the same block.

A very simple trick by its creator Guido Van Rossum to eliminate an age-old problem of the "C" language for which the loss of a line terminator often represented a huge problem. Useful tools (replit) Python comes with packages that can be easily installed on many operating systems, certainly all the most well-known ones. Along with the compiler also comes a small development environment called IDLE, essential and simple to use. It is a very useful tool to get started but cannot stand up to a challenge with complex solutions like repeat, Web IDE, which allows for fast and easy development without the worry of having to create and maintain the environment in which you operate.

repeat it is equipped with very advanced functions that support the developer by even suggesting code examples that can be quickly reused. It also allows code execution directly on the platform!

Alternatives to Python

There are many programming languages ​​available today, but none have the features of Python. In particular, the affection shown by its large community of developers has made numerous libraries available over time that expand capabilities to infinity and even to the infinitesimal. It is probably also necessary to point out that Python can also run on micro devices (MicroPython).

References:

https://www.python.org/about/gettingstarted/

https://docs.python.org/3/library/dis.html

https://docs.python.org/3/library/idle.html

https://micropython.org/

https://it.wikipedia.org/wiki/Guido_van_Rossum

https://it.wikipedia.org/wiki/Brian_Kernighan

https://it.wikipedia.org/wiki/Dennis_Ritchie

* Passionate about IT since childhood. He followed a scientific path, going through - and leaving happily - the great school of the Polytechnic of Turin. Trying to maintain the spirit of the eternal student, he works in the field of computer security. He loves programming, especially when he works towards simplifying man's life, without undermining its essence. In his free time, he dedicates himself to automation of all kinds!