What are the advantages of Python compared to Java? What are the drawbacks?

Source: Internet
Author: User

Reply content:

Know not all, throw a brick and other big God bar.

Advantages:
1. Python is more suitable as a dynamic language for novice programmers. Python allows beginners to focus on programming objects and ways of thinking without worrying about external factors such as grammar, type, and so on. Python's clear and concise syntax makes it much simpler to debug than Java. As to which is more "elegant" is purely personal preference, but for beginners of programming python more intuitive should have no objection.
2. Python has some powerful architecture 2.1 that Java does not have. Advanced Python Constructs That can express a very complex logic
3. Python has a very powerful support for asynchronous frameworks such as the Eventlet Networking Library , and as far as I know, Java is much more troublesome to implement these functions. Python is therefore suitable for some extensible background applications. (But in addition to Python extensibility is not as good as Java)
2. Python, as a scripting language, is more suitable for small applications and is ideally suited for prototyping in the early stages of application development.

Disadvantages:
1. The advantages of Python are inevitably sacrificed------because it is a dynamic language, it is slower than Java. You can imagine that the compiler takes time to check a specific type for a variable that has no typing. and Java compared to C + + and so on is not unpleasant, imagine a slower effect ... But many people think Python code is more concise, so actually running is not much more time consuming than Java.
2. Java is ideal for developing cross-platform applications, and almost every computer and smart machine can run Java. And Python is not the same ...
For their similarities and differences refer to Python vs Java:key Differences

That's the wrong place. Please point out: "How to write a multi-type--
I would like to say a little more to repay the Lord's thanks. I'm just getting started, and I can only give a little bit of information to people I don't know very well.

Python has a basic syntax similar to that of C + +, such as a logical structure with a judgment, a loop, a more flexible list of data structures, a dictionary, and an object-oriented class. In these basic aspects, Python is more flexible and understandable than C++/java, giving the impression that the author should be fed up with some awkward, redundant specifications in the C++/java when inventing Python. Because there are no rules, Python is easy to do with some simple data processing, much like Matlab.

Another powerful part of Python is the various libraries (module), which are powerful to the point where you feel like you're using them to write code that doesn't seem to have the same technical content. For example, you want to capture some of the data on the Web page, save it in accordance with the requirements of the format, just use the Urllib.request library to write 5 lines of code to crawl down the page, and then use the BeautifulSoup library with about 10 lines of code to parse the page data into a certain format. And that's just a small aspect of Python apps.
-
Welcome to all kinds of enlighten and discussion. It's cool. It's intuitive to say that the code written by Python is usually less than the average length of each line. Python open source, charging difficult advantages: no Java Popular
Cons: There is not much sense of existence in the language I think the disadvantage is:
1, Python is a bit slow, it seems cpython (official implementation) did not develop the JIT interpreter plan. Now there is a pypy project to do this thing, progress is good, worth looking forward to.
Of course, Python, it's really not important to be slow. This is not the feature of Python's focus. Requires a faster, smaller dynamic language to choose Lua.
2, it is easy to be anti-compilation. Public business projects may be weighed before they are used ...
3, class library naming style is not uniform, arbitrary large. Do not say the shortcomings, both are good language, casually say the advantages of it (in fact, the shortcomings can also be from the merits of the body to get, in addition I small white, if wrong, please correct me)
Advantages of Java:
1. The JDK is separated from the Java Virtual machine, the JDK is written in Java, and the Java Virtual machine is written in C + +, the developer does not need to spend a lot of effort to understand its context;
2. Cross-platform: once compiled, run everywhere;
3. Static language, Fast ~

Advantages of Python:
1. Simple interface, easy to use for beginners, high development efficiency;
2. Wide application area, what can do ~ advantages: Write cool. The average length of the line and the average number of rows are much smaller, with the ability to express five to 10 times times.
Disadvantage: No compiler check, not strong enough IDE support, fool can not write.

One of the motto: Grab an undergraduate, training three weeks Java can enter the project.
  • 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.