Vamei source: Http://www.cnblogs.com/vamei Welcome reprint, Please also keep this statement. Thank you!
Python is my favorite language, concise, beautiful, easy to Use. Two days ago, I was passionate about advertising the benefits of Python to my friends.
After listening, my friend asked Me: well, I admit Python is good, but why is it called python?
I'm Not quite sure: well, it seems to be the name of a TV show.
The friend asks Again: then you say Guido is an american? (author of Guido von Rossum,python)
I'm Not sure again: he switched from Google to dropbox, but his name was Dutch (there was a von in the middle).
so, I spent some time in the back looking into Python's history. It's a good Study. I've seen the origins of many features in Python and Python's design philosophy, such as what's left over from history, what functions are duplicates, How to add functionality ... moreover, Python is also a success story of open source Movement. From the history of python, we have a glimpse into the ideas and achievements of open source Development.
This can also be used as a preface to the Python quick tutorial I Wrote.
The origins of Python
The author of python, Guido von rossum, is really Dutch. Guido received a Master's degree in mathematics and computer Science from the University of Amsterdam (University of Amsterdam) in 1982. however, even though he is a mathematician, he enjoys the pleasure of computer. In his words, despite his mathematical and computer credentials, he tends to do computer-related work and is passionate about doing anything and programming.
Guido von Rossum
At that time, he contacted and used languages such as pascal, C, and Fortran. The basic design principles of these languages are to allow machines to run Faster. In the 80 's, although IBM and Apple have set off a wave of personal computers, the configuration of these personal computers is very low (in today's view). For example, the early macintosh, only 8MHz CPU frequency and 128KB of ram, a large array can fill the Memory. The core of all compilers is to do optimizations so that the program can Run. To improve efficiency, language also forces programmers to think like computers so that they can write programs that are more Machine-flavored. In those days, programmers wanted to squeeze every inch of the computer's ability with their HANDS. Some people even think that the C language pointer is wasting MEMORY. As for dynamic types, memory auto-management, object-oriented ... Don't think about it, it will paralyze your computer.
however, this way of thinking makes Guido feel Distressed. Guido knows how to write a feature in c, but the entire authoring process takes a lot of time (even if he knows exactly how to do it). Another option for him is the Shell. The Bourne shell has long existed as an interpreter for UNIX systems (interpreter). UNIX administrators often use the shell to write simple scripts to perform some system maintenance tasks, such as regular backups, file system management, and so On. The shell can connect many of the features under unix, just like Glue. Many of the C-language hundred lines of the program, under the shell only a few lines can be Completed. however, the nature of the shell is to invoke the Command. It's not a real language. For example, the shell has no numeric data type, and the addition operation is Complex. In short, the shell does not fully mobilize the function of the Computer.
(for shell, You can refer to Linux architecture and Linux command lines and Commands)
Guido wants to have a language that, like the C language, can fully invoke a Computer's functional interface, and can be easily programmed like a shell. ABC language let Guido see Hope. ABC was developed by CWI of the Netherlands (Centrum Wiskunde & Informatica, Institute of Mathematics and Computing). Guido worked in CWI and was involved in the development of the ABC Language. The ABC language is aimed at teaching. Unlike most languages at the time, the goal of the ABC language is to "make users feel better". ABC language wants to make language easy to read, easy to use, easy to remember, easy to learn, and to inspire people to learn programming Interest. For example, The following is an ABC program from wikipedia, which is used to count the total number of words (word) that appear in the Text:
How to RETURN words document: PUT {} "collection for line" document: for word in Split line: IF word n ot.in collection: INSERT Word in collection RETURN collection
How to defines a Function. A Python programmer should be able to understand this program very easily. The ABC language uses colons (:) and indentation to represent the program block (the C language uses {} to represent the block). There is no semicolon at the end of the Line. There is also no parentheses () in the for and if Structures. If you change how to def, change the put line to collection = [] and change the insert line to Collection.append (word), which is almost a standard Python Function. The above function reads like a natural text.
Despite the good readability and ease of use, the ABC language was not in vogue at the End. At the time, the ABC language compiler needed a high-profile computer to Run. Users of these computers are usually proficient in computers, and they think more about the efficiency of the program than the difficulty of learning it. In addition to hardware difficulties, the design of the ABC language also has some fatal problems:
- scalability is poor . The ABC language is not a modular language. If you want to add functionality to the ABC language, such as graphical support, you have to change a lot of places.
- IO cannot be done directly. The ABC language cannot directly manipulate the file System. Although you can import data in a way such as text flow, ABC cannot read and write files Directly. The difficulty of input and output is fatal for computer Language. Can you imagine a sports car that can't open the door?
- over-innovation . ABC uses natural language to express the meaning of the program, such as how to in the above Program. For programmers, however, They are more accustomed to using functions or define to define a Function. similarly, programmers are accustomed to assigning variables with an equal sign (=). While this makes the ABC language special, it actually increases the difficulty of the Programmer's learning (most programmers have more than one language).
- Transmission difficulties . The ABC compiler is large and must be stored on tape (tape). When Guido was visiting, it was necessary to have a large magnet brought to someone to install the ABC Compiler. In this way, the ABC language is difficult to spread quickly.
IBM tape Drive: Read and write tapes
In 1989, in order to pass the Christmas holiday, Guido began to write the Python language compiler/interpreter. Python comes from Guido's beloved TV drama Monty Python's Flying circus (an indoor sitcom from the bbc1960-1970 era, based on the British life at that time). He wanted the new language, called python, to implement his philosophy (a language between C and shell, full-featured, easy to learn, and extensible). As a language design enthusiast, Guido has had a (not very successful) attempt at designing Languages. This time, it was just a purely hacking act.
The birth of Python
In 1991, the first Python compiler (also an interpreter) was Born. It is implemented in C and is capable of invoking C libraries (. so files). From birth, python already has: class, function, exception handling (exception), core data types including tables (list) and dictionaries (dictionary), and module-based extension systems.
Original Python logo: designed by Guido's brother just von Rossum
Many of the python grammars come from c, but are strongly influenced by the ABC Language. Some of the rules from the ABC language are still controversial today, such as forced Indentation. But these syntax rules make python easy to Read. On the other hand, Python's clever choice obeys some conventions (especially in the C language). For example, use the equals sign to define the function using def. Guido that if the "common sense" on the establishment of things, there is no need to over-tangled.
Python has been particularly concerned about extensibility from the start (extensibility). Python can be expanded on multiple levels. From the top, you can introduce A. py File. At the bottom, you can reference the C-language library. Python programmers can quickly use Python to write. py files as an extension module. But when performance is an important factor to consider, python programmers can drill down to the bottom, write C programs, and compile into. so files for use in Python. Python is like a steel building, with a large frame set up First. And programmers can be quite free to expand or change in this Framework.
The original python was developed entirely by Guido Himself. Python has been welcomed by Guido Colleagues. They quickly feedback the use of comments and participate in Python Improvements. Guido and some colleagues form the core team of Python. They spend most of their spare time hack python (also including working hours, as they use Python for work). later, Python expands beyond Cwi. Python hides many of the details at the machine level, handing it over to the compiler, and highlighting Logic-level programming thinking. Python programmers can spend more time thinking about the logic of the program than the specifics of the implementation (guido has a T-shirt that says: life is short, I use python). This feature attracts a large number of Programmers. Python is getting popular.
We had to pause our Python time and take a look at the computer profile at this Point. In the early 1990, the PC began to enter the ordinary family. Intel released 486 processors, and Windows released a series of windowing systems starting with window 3.0. The performance of the computer is greatly improved. The programmer began to focus on the ease of use of the computer (compared to the graphical interface).
Windows 3.0
With the improvement of computer performance, the world of software has also begun to Change. The hardware is sufficient to meet the needs of many Pcs. Hardware vendors are even eager for high-demand software to drive hardware Upgrades. C + + and Java are popular in Succession. C + + and Java provide an object-oriented programming paradigm, as well as a rich library of Objects. At the expense of a certain performance, C + + and Java greatly increase the output of the Program. The ease of language is referred to as a new height. As we recall, an important reason for ABC failure is the performance limitations of the Hardware. In this respect, python is much luckier than abc.
Another change that quietly happens is the Internet. The 1990 's was the era of personal computers, with Windows and Intel carrying PCs to make the world Flourished. Although the Internet-centric information revolution has not yet arrived, many programmers and senior computer users have been using the Internet for frequent communication (including email and newsgroup). The internet has greatly reduced the cost of information exchange. A new model of software development has become popular: open source. Programmers use their spare time to develop software and open the source Code. In 1991, Linus released the Linux kernel source code on the Comp.os.minix news group, attracting a large number of hacker to Join. Linux and GNU work together to form a vibrant open-source platform.
Hardware performance is not a bottleneck, and Python is easy to use, so many people start turning to Python. Guido maintains a Maillist,python user to communicate via Email. Python users come from many fields, have different backgrounds, and have different needs for Python. Python is fairly open and easy to expand, so it's easy to expand or transform Python when the user isn't satisfied with the existing Functionality. These users then send the changes to guido, and the Guido decides whether to add new features to Python or the standard library. This would be a great honor if the code could be incorporated into Python itself or the standard library. Python itself has become better.
(guido had to make a lot of decisions, which is why he was called benevolent dictator for Life)
python, known as "Battery Included", is a powerful feature of its standard library. These are the contributions of the community as a whole. Python's developers come from a variety of fields, and they bring the benefits of different areas to Python. For example, the regular expressions in the Python standard library (regular Expression) refer to perl, while the lambda, map, filter, and reduce functions refer to Lisp. Some of the features of Python itself and most of the standard libraries come from the Community. The Python community continues to expand, with its own newsgroup, website (python.org), and the fund (python software foundation). Starting with Python 2.0, Python has also shifted from maillist's development approach to fully open source Development. Community atmosphere has been formed, work is shared by the entire community, Python has also been more rapid development.
(since Guido has the absolute right to arbitrate, many enthusiasts are quite concerned about Guido's life in the early days of Python's maillist development.) They even made assumptions about what python would be like if Guido hung up. See if Guido was hits by a Bus)
To this day, the Python framework has been established. The Python language is an object-centric organization code (everything is object), supports a variety of programming paradigms (multi-paradigm), and uses dynamic types (dynamically Typing) for automatic memory reclamation (garbage Collection). Python supports interpretation of run (interpret) and can call C library for Expansion. Python has a powerful standard library (battery included). As the standard library system is stable, the Python ecosystem begins to expand to Third-party packages. These packages, such as django, web.py, wxpython, numpy, matplotlib,pil, upgrade python into a Species-rich rainforest.
Today Python has entered the age of 3.0. Since Python 3.0 is backwards incompatible, transitions from 2.0 to 3.0 are not easy. On the other hand, Python's performance is still worth improving, Python's computing performance is lower than C + + and Java (see Google's discussion). Python is still a developing language. I look forward to seeing the future of Python.
The revelation of Python
Python advocates beauty, clarity and simplicity, and is an excellent and widely used language (the eighth Tiobe language, Google's third-largest Development language, Dropbox's base language, and the watercress server language). There is no shortage of good language in the world, but the history of Python as a representative brings me many Revelations.
The community has played an important role in Python's development process. Guido thinks he is not an all-powerful programmer, so he is only responsible for framing. If the problem is too complicated, he will choose to go around, that is, cut the Corner. These issues are ultimately addressed by others in the Community. The people in the community are exceptionally rich, and even creating a website, raising funds and so on with the development of something far away, there are people willing to deal with. Today's project development is becoming more complex, larger, more collaborative, and open-minded as the key to the ultimate success of the Project.
Python has learned a lot from other languages, whether It's abc, which is already in the history, or the C and Perl that are still in use, and many other languages that are not listed. It can be said that Python's success represents the success of all the languages it draws Upon. similarly, Ruby draws on python, and its success also represents some aspects of Python's success. Every language is a mixture, has its excellent place, but also has a variety of defects. At the same time, a language "good and bad" judgment, often constrained by the platform, hardware, The Times and so on external reasons. Programmers have been through a lot of language battles. I think, why not with an open mind and objective analysis, to distinguish the specific advantages and disadvantages of each language, to distinguish between internal and external Factors. Maybe one day I found out that I didn't like a language that contained what I Needed.
Regardless of Python's future destiny, Python's history is already an interesting novel.
If you are interested in Python because of this article, please read my Python quick tutorial.
This article mainly refer To:
Guido's presentation at Dropbox
Http://v.youku.com/v_show/id_XNTExOTc1NTU2.html
Python.org's Documentation
Wikipedia
A brief history of Python