What we can expand in computer language applications is that Python, as a common programming language, has its own characteristics. The new built-in modules can be written in C or C ++. If you have your own ideas on the Python design concept, we recommend that you watch our ideas on the Python design concept. We can also add Python interfaces to existing modules. Python allows you to focus on the program tasks to be implemented by avoiding excessive syntax constraints.
Python is also known as a clear language. The general guiding ideology of its authors when designing it is that there is only one best solution to a specific problem. This is expressed in The python motto "The Zen of Python" written by Tim Peters:
- There should be one-- and preferably only
one --obvious way to do it.
Interestingly, this is exactly the opposite of the central idea of TMTOWTDIThere's More Than One Way To Do It. This seems to be an important reason why people often compare Perl with Python.
The Python language is a clear language. Another meaning is that its author intentionally has a very restrictive syntax for the Python design concept, so that bad programming habits such as the if statement's next line does not indent to the right) can not be compiled. This intentionally forces programmers to develop good programming habits. One of the most important items is the indentation rule of Python.
For example, if statement:
- if age<21:
- print "You cannot buy wine!\n"
- print "But you can buy chewing gum.\n"
- print "this is outside if\n"
The difference between a module and most other languages, such as C) is the boundary of a module, it is entirely determined by the position of the first character of each line in this line, while the C language uses a pair of curly braces {} to clearly define the boundary of the module, is irrelevant to the character position ). This has caused controversy.
Since the birth of a language like C, the Syntactic meaning of the language is separated from the character arrangement, and it has been regarded as a progress of a programming language. But it is undeniable that Python makes the program clearer and more beautiful by forcing programmers to indent all the places where they need to use modules, such as if, for, and function definition.
In addition, Python also adheres to a clear and uniform style in the design of other parts, which makes Python a language that is easy to use, easy to maintain, and popular and widely used by a large number of users. The program segments directly written in Python sometimes run more efficiently than programs written in C. The above is an introduction to the content related to the Python design concept. I hope you will gain some benefits.