The Python programming language, its features, philosophy, and structure | MegaTech

Many people these days seek to learn to program, but one of the biggest problems they face at the beginning of their path is which programming languages they learn at the beginning, as there are many programming languages. In this article, we will talk about one of the most important programming languages that you can start with when entering this field, which is the Python language.

The Python programming language, its features, philosophy, and structure

What is the python language?

Python is a general-purpose, high-level programming language created by Guido van Rossum, first released in 1991, that focused on the readability of code through its impressive use of large whitespace.

Python is written dynamically and in a garbage collector system. It supports multiple programming paradigms, including structural programming (both proprietary and procedural), object-oriented programming, and functional programming.

Python is often described as the "included batteries" language due to its extensive standard library.

Python was envisioned in the late 1980s as a successor to the ABC language. The version (Python 2.0), released in 2000, introduced features such as a list comprehension, a waste collector system, and the ability to collect reference courses. Python 3.0, released in 2008, had a major revision of a language that was not fully backward compatible, and not many Python 2 code runs unmodified on Python 3.

Python 2 was officially discontinued on January 1, 2020, and no other security patches and improvements have been released.

With the end of life (Python 2), only (Python 3.5.x) and later versions are supported.

Python compilers are available for many operating systems.

A global community of programmers develops and maintains a Python compiler called CPython, an open-source reference. The Python Software Foundation, a non-profit organization, manages the resources for developing the Python programming language and its compiler (CPython).

The birth of the Python language

Python was created in the late 1980s by Van Rossum at Centrum Wiskunde & Informatica CWI in the Netherlands and is considered the successor to ABC (inspired by SETL).

A Python language capable of interacting with the Amoeba OS, (Amoeba: It is an open-source distributed kernel operating system developed by Andrew Tannenbaum and others from the University of Verge. One. It seems that the development of the project has been delayed as the last update in the 5.3 version files was on April 21, 2001.).

Implementation began in December 1989. Van Rossum assumed full responsibility for the project, as the lead developer, until 12 July 2018, when he declared his “permanent leave” and relinquished his responsibilities after spending a long period of commitment to serve as the main decision-maker for the project. He is now involved as a member of the five-person steering board to lead the project.

Python 2.0 version

This version includes some new features, including:
  • Garbage Collector: In computer science, it is the process of collecting unused resources in computer memory (RAM): It is a form of automatically organizing computer memory as the process of collecting waste aims to search for unused resources in memory And then remove them to get free space of memory to use for other work.

  • Cycle-Detecting In computer science, cycle detection is an algorithm problem or algorithm problem that aims to find a cycle in a series of values ​​of recurring functions. For any function (F) that assigns (S) a finite set to itself, and any prime value (x) in (S), the sequence of values ​​of the repeated functions.

  • Unicode support: The IT standard for consistent representation, encoding, and handling of expressed text in most global writing systems. The standard is maintained by the Unicode Consortium, and as of March 2020, the latest version (Unicode 13.0), contains a reference of 143,924 characters covering 154 modern and historical scripts, as well as multiple symbol and emoji sets. The Unicode character set is synchronized with ISO/IEC 10646, both of which are identical in code.

Python 3.0 version

(Python 3.0) was released on December 3, 2008. It was a major revision of the language not fully backward compatible.

Several major Python 3.0 features have been traced back to the Python 2.6.x and Python 2.7.x series, and the Python 3 releases include the (2to3) utility, which (at least partially) automatically compiles Python 2 to Python 3 code.

An expiration date for Python 2.7 was set in 2015, then pushed back to 2020 for fear that a large body of existing code could not be easily ported to a Python 3 release.

The origin of the name Python

The name Python derives from the British comedy group Monty Python, which Python creator Guido Van Rossum enjoyed while developing the language. For example, the metasyntactic variables often used in the Python literature are the "Spam" and "Egg" symbols rather than the traditional symbols used in mathematics.

The official Python documentation also contains various references to the Monty Python routine.

We use The prefix to show anything related to Python. Examples of using this prefix in the names of Python applications or libraries include (Pygame), which is an SDL link to Python (usually used to create games), (PyQt), and (PyGTK), which links (Qt) and (GTK) are in Python respectively, and (PyPy) is a Python application originally written using the Python language.

Features of Python language

Python is a multi-paradigm programming language that fully supports Object-Oriented Programming and Structured Programming, and many of its features support functional programming and Aspect-oriented programming. Oriented Programming, including Metaprogramming and Metaobjects. It also supports many other models via extensions, including Design by Contract and Logic Programming.

Python uses a dynamic typing system, and a combination of reference counting, waste collectors, and cycle detection to manage memory. It also features dynamic name resolution (delayed binding), which associates methods with variable names during program execution.

The Python design provides some support for functional programming, and it has a filter, mapping and minification functions, list comprehension expressions, dictionaries, collections, and a generator.

The standard library contains ( itertools ) and ( functools ), which implement functional tools borrowed from the Haskell and Standard ML programming languages.

Python language philosophy

The basic philosophy of the Python language is summarized in the document (The Zen of Python PEP 20).

The philosophy of the Python language includes a set of proverbs and aphorisms, such as:

  • Beautiful is better than ugly.
  • Explicit is better than implicit.
  • Simple is better than complex.
  • The compound is better than the complex.
  • Readability is important.
  • Rather than integrating all of its functions implicitly, Python is designed to be highly extensible.

This built-in module has made it particularly popular as a way to add programmable interfaces to existing applications.

Van Rossum's vision of creating a small base language with a large standard library and an expandable compiler predicted that he created a language that was easy compared to the frustrations of ABC which took the opposite approach.

Python strives to build simpler and less cluttered syntaxes while giving developers a choice in their programming methodology. In contrast to Perl's motto "there is more than one way to do it", Python espouses "there should be one design philosophy - preferably only one - and a clear way to do it".

Perl is a family of interpreted, high-level, general-purpose dynamic programming languages.

Alex Martelli, a fellow at the Python Software Foundation and author of the Python book, writes that:

Development philosophy

Python developers seek to avoid premature optimization and reject patches for unimportant parts of the CPython implementation, with a reference wrapper that provides marginal increases in speed at the expense of clarity.

And when speed is important, a Python programmer can port all critical functionality to additional modules written in other programming languages such as C, or use the PyPy compiler. Cython is also available, which translates a Python script into C and makes an API call directly from C to the Python interpreter.

One of the important goals of Python developers is to keep it fun to use.

This is reflected in the language's name, which came in honor of the British comedy group Monty Python, and in the sometimes hilarious approaches to educational programs and reference materials, such as the examples referring to symbols from the famous Monty Python drawing rather than traditional mathematics symbols (x, y).

A popular tag in the Python community, which can have many meanings related to the style of the program, is called Pythonic, meaning that it uses Python terminology well, is natural or demonstrates fluency in the language, and conforms to a simplified philosophy of Python and an emphasis on readability.

In contrast, code that is difficult to understand or that reads like rough copies of another programming language is called a non-Pythonian language. Python users, experts, and fans are also called Pythonists.
Post a Comment (0)
Previous Post Next Post