Java or C++

Andrew Dalke dalke at acm.org
Sun Apr 9 08:06:06 EST 2000


Malay wrote:
> I beg to differ [with Dr. Quinn's statement]. This attitude has
> created lot of problems for me at least.  Each of this languages
> is a midset by itself and sometimes can be a lifetime affair by
> itself.

My reply to his point was that if the answer is to learn both C++
and Java because "It will help you get used to the idea of quickly
taking on new languages", then it would be better to learn only one
of those two *and* another language which is more dissimilar.

> Like I said one life is not enough to learn a language
> like "C".

Of the language I listed, I think C++ is the hardest.  I think
it takes a good couple years to be good with it, and about 4-5
years to work out some of the subtle parts.  The "lifetime" is
only needed to understand some of the truely deep and complex
issues, which rarely come up in real life.

Something like Python only takes a couple of months to understand
well, though there are still a couple of new areas for me after
two years.

I said:
>> But if that's the point, C++ and Java are too close together to
>> get an idea of the spectrum of languages available.

You replied:
> Not very close. Syntax wise may be. But structure wise completely
> different.
> And each one require a different approach to solve a problem.


I'm going to have to disagree with you here.  Java is a lot
closer to C++ than to any of the other languages I mentioned (Perl,
Python, Scheme, Smalltalk, Eiffel, Haskell, Forth, APL, J, or
Prolog).  Compared to the last few languages, C++ and Java might as
well be the same language, since it's relatively easy to write
Java-like code in C++, but I can't even imagine how to write
Java-like code in Prolog.

My point is that without learning at least a bit of why other
languages exists, it's hard to judge how similar or dissimilar
C++ is from Java.

Oh, and probably Eiffel is next closest language to Java, followed
by Perl or Python.  Eiffel has a different view of how to deal
with types, introduces the concept of pre- and post-conditions,
and does exceptions and multithreading in ways that aren't quite
the way I like them, but at least it's statically typed.  The two
P languages are both dynamically typed, and by capability rather
than class.

>Goshh!!!!!! I want to be immortal...

Nahh, you don't have to be *good* in all those languages; just
know what they're about.  Eg, I've only read through the Eiffel
and Smalltalk books, and some of the commentaries about them.
I've done enough with APL to like it and realize why I'll never
use it for anything, and the same with FORTH.

Besides, I ended up saying:
> I should point out that of these languages, I've only heard of
> people using Smalltalk for bioinformatics software.

which suggests that if you wanted to "get used to the idea of
quickly taking on new languages" and still be realistic about
being able to use those languages, then when combined with my
original answer means you should learn C++ and Smalltalk.

Though I really recommend C++ and Python, and skipping Java.

                    Andrew
                    dalke at acm.org









More information about the Bio-soft mailing list