Python is engineering, not art.

Source: Internet
Author: User
Tags readable

When Python first emerged on the software scene in the early 1990s, it spawned what's now something of a classic conflict Between its proponents and those of another popular scripting language, Perl. Personally, I think the debate is tired and unwarranted today-developers be smart enough to draw their own conclusions.
   still, this was one of the most common topics I ' m asked about on the training road, so it seems fitting to say a few wor DS on the topic here.

When Python appeared in the early 90, it stirred a classic clash between Python supporters and another fashionable language, Perl advocates. Now the debate is over.

Personally, the argument is boring and groundless. Developers are very smart and know how to choose. So far, this is still one of the most famous themes.

In the course of my training, I will often be asked, so it is necessary to say a few words on this topic.

The short stories is this:you can does everything in Python so you can be in Perl, but can read your code after your it. That's it-their domains largely overlap, but Python was more focused on producing readable code.                                                         For many, the enhanced readability of Python translates to Code reuseability and maintainability, making Python a better C Hoice for programs that would not be written once and thrown away. Perl code is easy-to-write, but difficult to read. Given that most software have a lifespan much longer than its initial creation, many see Python as a more effective tool.

It's plain to say: Perl can do it, Python can do it, but you have to read it after you write it. Obviously, this is the big intersection between them.

It is obvious that Python is more focused on the readability of the code and, in most cases, improves the readability of the code into: Code reusability and maintainability.

This makes Python a good choice: discard when it's not written. Perl code is easy to write, but difficult to read.

Since the software has a long life cycle, it is much longer than the initial development because many people see python as a more effective tool.

The somewhat longer story reflects the backgrounds of the designers of the and the Languages,and underscores of the main Reasons people choose to use Python.python ' s creator are a mathematician by training; As such, he produced a language witha high degree of uniformity-its syntax and toolset is remarkably coherent. Moreover,like Math, its design was orthogonal-most of the language follows from a small setof core concepts. For instance, once one grasps Python's flavor of polymorphism, Therest is largely just details.
This largely reflects the background of the two language designers and reflects the reasons why many people choose to use Python.

The creator of Python is a well-trained mathematician, which makes the language of its invention highly unified:

Her grammar and toolset are remarkably coherent. More even, like math, its design has orthogonality:

that is, most languages follow a small set of core concepts. For example, once you have mastered polymorphism, most of the others are details, that's all.

By contrast, the creator of the Perl language are a linguist, and its design reflects this heritage. There is many ways to accomplish the same tasks in Perl, and languageconstructs interact in context-sensitive and Sometim Es quite subtle ways-much likenatural language. As the well-known Perl motto states, "There ' s more than one-out-of-the--it." Given This design, both the Perl language and its user community has historicallyencouraged freedom of expression when WR Iting code. One person's Perl code canbe radically different from another ' s. In fact, writing unique, tricky code is often asource of pride among Perl users.
In contrast, the creator of Perl is a linguist, so its design reflects the characteristics of the language.

In Perl, there are many ways to do the same task, and the structure of the language is influenced by contextual interactions.

Sometimes very sensitive, much like natural language. As the famous Perl motto says:

All roads through Rome! Given this design, not only the Perl language itself, but also the Perl user community,

Encourage and advocate the spirit of freedom in writing code. So a person writes out the code

Very likely to be different from others! In fact, Perl developers often take pride in writing unique, skilled code!

But as anyone who have done any substantial code maintenance should being able to attest,freedom of expression was great for AR T, but lousy for engineering. In engineering, weneed a minimal feature set and predictability. In engineering, freedom of expressioncan leads to maintenance nightmares. As more than one Perl user have confided to me,the result of too much freedom are often code that's much easier to rewrite From Scratchthan to modify.
But those who have maintained a lot of code can prove that the spirit of free expression is great for art.

But for engineering, it's very annoying. From an engineering standpoint, we need to minimize feature sets and predictability.

In the field of engineering, free expression can cause a maintenance nightmare. More than one Perl user confided to me:

Too free The result is: The program is easy to start from scratch, but it is difficult to modify it!

Consider This:when people create a painting or a sculpture, they do so for themselvesfor purely aesthetic purposes. The possibility of someone else has to change thatpainting or sculpture later does not enter into it. This is a critical difference Betweenart and engineering. When people write software, they is not writing it for themselves. In fact, they is not even writing primarily for the computer.  Rather, goodprogrammers know that code was written for the next human being who had to read it inorder to maintain or reuse It. If that person cannot understand the code, it's all but uselessin a realistic development scenario.
In view of this: When people apply lacquer painting to the statue, they can apply it out of sheer aesthetic angle.

As for the future, someone has to change his lacquer or creative, not in the scope of his consideration.

This is the most critical distinction between art and engineering. When people write code, they don't write purely for themselves.

In fact, they are not even written specifically for computers. Of course, good programmers know:

The code is written for those who maintain or even rewrite it in the future. If the person responsible for maintenance doesn't understand the code at all,

In reality, then, the code is almost useless.

This is where many people find the Python most clearly differentiates itself from scriptinglanguages like Perl. Because python ' s syntax model almost forces users to writereadable code, Python programs lend themselves more directly to The full softwaredevelopment cycle.  And because Python emphasizes ideas such as limited interactions,uniformity, regularity, and consistency, it more directly Fosters code that can was usedlong after it was first written.
This is where many people discover that Python differs from another scripting language in Perl's most significant place.

because the Python syntax mode forces the user to write readable code, the Python language guide them forward towards the complete software development process. Because Python is more emphatic:

Limited interactivity, consistency, discipline, and coherence can further lead to: Python can run for a long time since it was first written.

In the long run, Python's focus on code quality in itself boosts programmer productivity,as well as programmer satisfactio N. Python programmers can be creative, too, ANDAs we'll see, the language does offer multiple solutions for some tasks. At its Core,though, the Python encourages good engineering in ways the other scripting Languagesoften does not.
For a long time, Python's focus on code quality has also increased programmer productivity and developer satisfaction.

Python programmers will become more creative, and we will later understand that for some projects:

The language does offer a variety of solutions. At its core, Python advocates that engineering is developed in ways that other scripting languages do not.

This is a consensus among many who use Python. Of course you can judge for yourself: What exactly does Python offer you?.


Note: The English article is excerpted from the learning Python python is Engineer,not art section.

Python is engineering, not art

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.