Author: http: //taowen.bitapf.org
Recently, I have passed the article in BBS, I'm too lazy to write things, and I will decide the pen. The first common view is that Python and Basic should be easy to learn, but the weak language Basic is a memories of many people's young people, gvbasic, gwbasic, qbaisc, various versions bring many people to happiness Inside the world. But many people will waste it after BASIC, because I feel that there is too much functionality in addition to playing with PLAY. Even VB, it is also not very perfect, and many places must rely on other language written components and directly call the API to complete the function. And Python is like a toy due to rough look. And the sense of teaching language brought about by the interactive command is even more enhanced. But Python actually functions cannot be said weak, actually very powerful. Python has built-in important data structures and files, and contains a large standard library that basically covers the requirements from the GUI to the database to the network. And there are still many enthusiasts, company companies write third-party libraries for Python, which has a wide variety of libraries and complete functions. Moreover, it is also possible to use the library of other languages to use them to use them, and the library that is used directly to write extensions. So, Python is as good as Basic, but the function is much stronger. The second common view is: Python speed is very slow, only in very few applications for people who are used to compilation and C , thinking always has a inertia (including myself, I have experienced such a stage) . That is to watch the file size is a digital, any Overhead at any runtime is absolutely no. Then see the dynamic language like Python, and the language is very powerful, how to see how it is not pleasing to the eye. The key problem is the first thing you need to save such a size of 100 ~ 200k, now the memory, hard disk, and network communication environments are not much space, so size is not a problem. The key is the runtime? In fact, in many occasions, it is not necessary, such as opening a window, running if you delay 100ms, do you feel? Python can also perform some processing of the PY file into a PYC file, an interpretation of the source file. Pre-read, pre-compiled technologies such as Java's virtual machines can be used for Python. Python has a very great advantage that it is possible to write extension modules with a fast language. In the software, it is generally 20% of code occupies 80% of running time. This way you can use the tool like Benchmark to see if the software is slow, and then use Profiler to find the problem bottleneck, then you can solve the critical code with C. This saves the development time (most code writes with Python, faster than C), and running speed can also be satisfactory. So, for Python's speed, it is not worrying. But for the objective, Python is slow, what is in Python, this is a matter of not so pure OO language than Java, it is worse. The third common problem is: Because Python is dynamic, the program is easier to have an error, which is mainly thinking that because Python is dynamic, there is a lack of static type check, then the error in the program is hard to find. Setting that the syntax of the block that is not performed is not completely checked. Variables are easily misunderstood because there is no statement.