[Tutor] Differnce between java and python

Alan Gauld alan.gauld at freenet.co.uk
Thu Dec 22 10:38:31 CET 2005


[Putting this back on the list so others get the context info]

----- Original Message ----- 
From: "shivayogi kumbar" <shivayogiks at gmail.com>
Subject: Re: [Tutor] Differnce between java and python


Sir I have completed  my Msc(c.s).I have worked on java and also done my
project on javaa using swings ,RMI  technology.The thing is now I have
joined the company is working on the Python.So I would ike to know the
difference between Java and Python

------------------------------

In that case since you have a good knowledge of Python we 
can focus on a feature comparison with Java.

Python has much in common with Java in that both work by compiling to byte 
code, however Java does so in a traditional comipile first manner whereas 
Python compiles at first run. 

Python is dynamically typed and uses protocol based polymorphism 
rather than inheritance based(so called Duck typing).

Python is a much higher level language than Java, I'd guess the 
ratio of lines of code per function point is around 3:1. Python is 
often called 'executable pseudo code'.

Python has a much more elegant syntax, it is much less based on C 
(Although some C-isms do show through in places)

Python is more object oriented than Java which is predominantly 
class based. By that I mean there are lots of objects around in Python 
where you never see the class. Similarly there are relatively few class 
methods (static in Java). You can't use Java wthout without seeing at 
least one class statement.

Python has much better support for higher order programming, 
functional programming and, more debateably, meta-programming.

There's lots more but that should e enough for now.
Check the refeences others have sent. 
Also check out Jython which combines the best of both worlds with 
remarkably few compromises. 

Alan G
Author of the learn to program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld




More information about the Tutor mailing list