IUBio

Java or C++

Petr Kuzmic pkuzmic at biokin.com
Wed May 3 08:41:57 EST 2000



Herbert M Sauro wrote:
> 
> Korbinian Strimmer <strimmer at ermine.ox.ac.uk> wrote in message
> > > Which language will be "the language" in Bioinformatics, Java or C++?
...
> So that do the companies I've worked for use? Well they certainly use Java
> but on the whole only for server side work, GUI applications written in Java
> tend to be slow and cumbersome...

I use Java to design *portable* GUIs.  The interfaces are not as fast as
native code, but the portability surely is nice.  Imagine compiling a
moderately complex Java GUI on a Windows machine.  You can then simply
copy the binary byte-code to the Macintosh box, or a Linux box, or an
OS/2 box, and just run it showing the same interface on all machines.  
Of course there are some restrictions: you have to stick to Java 1.1 at
the present time.

Bottom line on the GUI issue, in my opinion: the original poster should
consider both *portability* and *performance*.  If platform independence
is very important (Win, Mac, Unix, Linux, OS/2, Be, ...), use Java to
build GUI's.  If performance is very important, use C++ or toolkits like
Tcl/Tk.

Another important difference between C++ and Java is how they handle
multi-threading.  This is potentially very important for a scientific
program doing lengthy computations.  In C++, the programmer has to
design the multithreading mechanism by hand from scratch (mutexes,
critical sections, semaphores, all that jazz...), while in Java
multithreading is handled at the language level.  This makes it
*relatively* easy to write threaded applications in Java.  For example,
one "worker" thread can be doing a lengthy scientific computation, while
another "manager" thread is offering the user -  the "boss" - to
terminate the "worker" if it seems too slow (Labor Movement language
unintended). 

> ... the windows environment is ... very cheap, particularly the hardware.

Yes, but the Windows operating system software cost seems staggering. 
Windows-2000 is quite expensive and (at the present time) very hard to
maintain.
 
> Now I'm not saying people should go off and use Delphi or what ever, but do
> remember there are other things going on in the computing world other than
> Tkl/Tk, Perl, etc. It always surprises me how narrow we sometimes are in our
> views of the world.

True.  But it is also true that a master craftsperson will use whatever
tool is best suited for the given task (Perl for text processing, Java
for portable GUIs, C++ for fast native libraries, Fortran for quick
prototyping using legacy scientific code, etc.).  The more tools in
anyone's toolchest, the better!

Just my $0.02s worth.

	-- Petr

_____________________________________________________________________
Petr Kuzmic, Ph.D. * BioKin, Ltd. * Consulting & Software Development
http://www.biokin.com * (608) 256-4790 * (608) 256-1269 FAX





More information about the Bio-soft mailing list

Send comments to us at biosci-help [At] net.bio.net