Kent West <[EMAIL PROTECTED]> writes:
> Shaleh was the one to plug python first. But what dman says here gets
> my attention. Do others concur that python is more cross-platform and
> more OO than java? What are the disadvantages with python as opposed
> to java? Why would someone pick java over python then? Is it only
> because of marketing, as dman says?

Jumping in: Java's big advantage, in my mind, is that the language has
nice static checking properties.  All you can really check at
compile-time for Python (such as it is) is that the program is
syntactically correct.  This Python program:

  class Foo:
    def __init__(self): pass
    def bar(self): print "Hi there!"

  foo = Foo()
  foo.baz()

passes through the "compilation" part fine; the actual error isn't
caught until the code tries to execute foo.baz() and discovers that
there's no such method.  In contrast, in Java, this would be caught in
the compiler, which can be a win if the error is on a seldom-executed
code path following a long computation.

Java's syntax is closer to C/C++, and actually close enough that you
can almost tell a C++ programmer "well, there's no delete,
everything's inline, public/private go in front of things instead of
being a label, and every object variable is really a pointer" and they
can go.  Python is sufficiently different to panic grad students who
are told that they need to create some course tools in it within the
next week.  (Though having gotten through the panic, it's actually not
that hard.)

Java is more buzzword-compliant, if you need to deal with that.  Your
local PHB is probably more likely to buy "it was a major project in
Java" than "it was a major project in Python".  In my experience, your
local (Solaris, Windows, ...) machine is more likely to have a JVM
than a Python interpreter.

Java has a redistributable "binary form", if you're the sort that
feels the need to obfuscate their source.

(I think the languages that interest me more have the interesting
static properties.  C is pretty ugly, when you get down to it, and
Java has weird artifacts and limitations.  You'd like to be able to
separate specification from implementation, and this is completely
impossible in Java [and a pain in C++, but doable].  One of these days
I'll get around to doing a reasonable-sized project in Haskell,
though: it has an incredible type system and seems to do the right
thing around "classes", though this is only so meaningful in a purely
functional language.  Saying "well, I wrote about half of a compiler
in Haskell" certainly gets interesting reactions from the right sort
of people...  :-)

-- 
David Maze         [EMAIL PROTECTED]      http://people.debian.org/~dmaze/
"Theoretical politics is interesting.  Politicking should be illegal."
        -- Abra Mitchell


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to