[Tutor] Slightly OT - Python/Java

Alan Gauld alan.gauld at freenet.co.uk
Mon Jan 10 21:04:29 CET 2005


> ...on Java ...
> quite like, much superior to C++, although it does lack the elegance
of
> Python and Ruby.

Superior is a relative term. Java has lots of huge restrictions
compared to C++ - the lack of operator overloading being maybe
the biggest, since it prevents true sub typing of builtins and
primitives - thus resulting in extra(and horrible) code.

And the lack of functionpointers (inner classes not withstanding)
is a big hit, and what about multiple inheritance - interfaces suck!

Its also much slower - JIT compilers, and even native compilers,
notwithstanding. I could go on...but...

It is however, a simpler language to learn, and I must admit
that having got used to garbage collection in Python going
back top C and C++ is a shock... And the large standard library
(even if the design is awful in places) is an advantage.

> RubyCocoa anyway, so that'd be equivalent to using Objective-C).

Have you used Objective C itself? I like it a lot. It combines
much of what I like about both C++ and Python.

> Also, Java has something which Python lacks (yet should have):
> private/protected/public class members. In Python, everything is
> public, which I consider to be a Bad Thing(TM).

Why do you think it should have it? Have you run into a lot of
problems with inappropriate access in Python programs? This often
comes up from ex Java/C++ programmers yet access control like
this was not part of any of the earliest OOP languages and nobody
ever discussed it much(SMalltalk took one extreme - all data
private, and Lisp the other - all public) But I don't recall
have any big issues with lack of control, and I don't find
it an issue in Python.

What exactly do you find to be such a problem with the lack
in Python?

> Does runtime in Java include startup? Every time you start a java
> program, it has to load a BIG runtime in memory (roughly 30 megs of
> classes -- that's both Java's curse and blessing).

True of Python too of course, you have the initial
interpretation/compile stage before execution starts.

> And of course, it's free (and written in Java).
http://www.eclipse.org

So many editors, so many languages :-)

Alan G.



More information about the Tutor mailing list