The application scope of Python is increasing dramatically day by day

Source: Internet
Author: User

Some people will know that C, C ++ and other languages manage blocks by {}, while the new version of Python is managed by indentation, this indeed makes up for the shortcomings of the previous language. I believe many programmers have missed.

If the compiler or interpreter used is excellent, you can easily add missing {}. However, if this is not the case, I think you will start roaming in complicated code. Because, maybe your compiler will tell you an error message, and the location of this error may be about 108,000 miles away from the real error ).

In contrast, for the Python application scope that uses indentation management, programmers almost do not need to consider this issue. Second, the Python code that distinguishes blocks by indentation is much clearer in complicated nesting. The following comparison between Python and C ++ on nesting:

 
 
  1. #!/usr/bin/python  
  2. #python source  
  3. class python:  
  4.   def Hello(self):  
  5.     print 'Hello'  
  6.   def count(n):  
  7.     in=0 
  8.     while(in<=n):  
  9.       inin=in+1  
  10.       print in  
  11.  
  12. //buile by G++ or VC++  
  13. //C++ Source  
  14. #include <iostream> 
  15. int main()  
  16. {  
  17. class python  
  18. {  
  19. public:  
  20. void Hello(void)  
  21. {  
  22. cout<<"Hello"<<endl;  
  23. }  
  24. void count(int n)  
  25. {  
  26. int in=0;  
  27. while(in<=n)  
  28. {  
  29. inin=in+1;  
  30. cout<<in<<endl;  
  31. }  
  32. }  
  33. };  
  34. return 0;  
  35. }  

In comparison, Python code can be further divided into different levels, while C ++ code can be compiled successfully. However, future maintenance will cause endless pain. At the same time, when I wrote C ++ Source, I almost missed it };. The Python syntax is concise. At the same time, he has a very strong ability to make mistakes. In general, the Python interpreter can accurately identify the location and cause of the error. The following code:

 
 
  1. #!/usr/bin/python  
  2. #python source  
  3. class python:  
  4.   def Hello(self):  
  5.     print 'Hello'  
  6.   def count(n):  
  7.     in=0 
  8.     while(in<=n):  
  9.       inin=in+1  
  10.       print in  
  11.  
  12. //buile by G++ or VC++  
  13. //C++ Source  
  14. #include <iostream> 
  15. int main()  
  16. {  
  17. class python  
  18. {  
  19. public:  
  20. void Hello(void)  
  21. {  
  22. cout<<"Hello"<<endl;  
  23. }  
  24. void count(int n)  
  25. {  
  26. int in=0;  
  27. while(in<=n)  
  28. {  
  29. inin=in+1;  
  30. cout<<in<<endl;  
  31. }  
  32. }  
  33. };  
  34. return 0;  
  35. }  

It is easy to see the cause and location of the error. In this mechanism, when you debug complex programs, you do not have to worry about the inability to quickly solve the problem. You only need to follow the Python error prompt and correct it step by step. For Python applications.

I personally divide it into several categories. The first class is software, which should be clear to everyone. Compared with C ++ and other languages, Python has the advantage of rapid development and code opening. For Python, you can open a notepad or Kwriter to write code, save it, and run it. Even complex code. This greatly reduces the development cycle and speeds up development.

Compared with traditional editing, compilation, and connection operations. Python is less troublesome. Three steps and two steps. Because of Python's concise code and short training time, it is very easy to develop and maintain software.

The Python code is interpreted as follows: After Python is installed, Python does not have to be installed for Python software. It's okay to run the software directly. For developers, product updates and fixes are easier.

  • Important factors affecting the development of Python
  • Details about the status of the Python Virtual Machine
  • How to distinguish Python threads correctly
  • Analysis on Python virtual machine execution framework
  • Introduction to the Python runtime environment in the Python Virtual Machine

Maybe you only need to spend time browsing a web page to fundamentally fix bugs in the product. Thanks to Python code reuse and flexible code management. For errors that occur at the user end, developers can diagnose errors that come with the Python application scope.

Moreover, there are a lot of Python-related code libraries on the Internet, and these are free of charge. For Development enterprises, it can save a considerable amount of development money. Therefore, Python has its own characteristics and market in the software market.

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.