What's the difference between Python and Java?

asd3331380 2022-01-15 03:04:12 阅读数:459

difference python java

from : Micro reading (www.weidianyuedu.com) Micro reading - Complete collection of model articles - Free learning website

A lot of beginners are asking :“Python and Java What's the difference ? Is it learning? Python still Java.“

A melancholy look , It's hard to do .

today , I have summed up twelve differences between the two .

One 、 To be honest ,Python Virtual machines don't have java strong ,java Virtual machine is java At the heart of

Python The core of is that you can easily use c Language function or c++ library .

Two 、Python It is fully dynamic

You can modify your own code at run time ,java It can only be achieved by workarounds .

Python The variables are dynamic , and java The variable is static , It needs to be stated in advance , therefore java ide The code prompt function of is better than Python ide.

3、 ... and 、 design idea

Python For decades , Decades ago, process oriented was the mainstream , So use Python Many programs use process oriented design methods , Many concepts range from c Language comes from ,class stay Python Is added after , and java In order to achieve a pointer free c++( That year com Reference count for component ,java The virtual machine used ), It mainly adopts the object-oriented design method , Many concepts are oop The concept of .

Process oriented , Relatively simple and intuitive , But it's easy to design a noodle program , object-oriented , Relatively abstract and elegant , But it's easy to be too abstract .

Four 、 In actual use Python Easy entry

But learn to use Python work , Need to learn again Python Various libraries ,Python The power of lies in the library , Why? Python The library is powerful , as a result of python The library can be used python,c Language ,c++ Wait for the design , And then to python Use .

So no matter gpu function , neural network , Intelligent algorithm , Data analysis , The image processing , Scientific Computing , All kinds of warehouses are waiting for you to use .

and java No, Python So many open source libraries , Many libraries are used internally by commercial companies , Or publish it is just a jar package , Can't see the original code .

Python The virtual machine is not because of compilation java Good support ( Or deliberately designed ), Generally use the source code directly (linux), Or simply pack the source code ( Such as pyexe).

5、 ... and 、Python There are many virtual machine implementations

Such as cython,Pyston,pypy,jython, IronPython wait , Suitable for business languages , Or plug-in language , Or domain oriented language , and java Because virtual machines are huge , Rarely used in plug-in languages , It's not convenient to publish .

6、 ... and 、java It is mainly used in areas with strong business logic

Such as mall system ,erp,oa, Finance , Insurance and other traditional database transaction fields , Through something like ssh Framework transaction code , For commercial databases , Such as oralce,db2,sql server Better support , Strong software engineering concept , Multi person development mode suitable for software engineers .

Python It is mainly used for web Data analysis , Scientific Computing , Financial analysis , Signal analysis , Image algorithm , Mathematical calculation , Statistical analysis , Algorithmic modeling , Server operation and maintenance , Automation , Strong concept of rapid development , Suitable for rapid development team or individual agile mode .

7、 ... and 、java Commercial companies support more

Such as sap,oracle,ibm etc. , There are commercial containers , middleware , Enterprise framework ejb.python Many open source organizations support , Such as qt,linux,google, Many open source programs support python, Such as pyqt,redis,spark etc. .

8、 ... and 、Python The most useful is the script ,java The most useful is web

Python It's glue , You can stick all kinds of irrelevant things together ,java It's gay , You can form a team of hundreds of people through software engineering and you pk, The commercial atmosphere is heavy .

But I think it's still Python Powerful , Because it is convenient to call c or c++ The library of , But software engineering and commercial operation do not java good , Suitable for rapid development .

Nine 、 About money

If you want to write programs and sell software java, Available on ibm The server , On oracle database , On EMC Storage , high price , Commercial purchasing companies like this kind of tall .

If you want to program money directly, use Python,Python It can realize kuanke Finance , Data back testing , Stock speculation , Speculation option , Stir fried gold , Stir fry bitcoin , Hedge arbitrage , Statistical arbitrage , There are many open source libraries , Data analysis library , Machine learning library can refer to .

Ten 、java and Python, Can run on linux operating system

But many linux It can support Python,java Self installation required .

Java and Python be better than c# The reason is greater than support linux, Support osx, Support unix, Support arm.java and python Than c++ The reason for its popularity is that there is no need for pointers .

11、 ... and 、 For mobile Internet

Python It can only run on Android or through the runtime ios,java Native support for Android development , But it can't be used. ios in .

Twelve 、 For big data

Hadoop use Java Developed , Spark use Scala Development ,Scala be based on JVM,Flink Is based on Java. Big data development Java,Python It is mainly used for big data analysis .

版权声明:本文为[asd3331380]所创,转载请带上原文链接,感谢。 https://javamana.com/2021/12/202112122254484902.html