Newbie question - Disadvantages of java

M

Martin Wildam

Hi folks,

as I am about to switch to java, can somebody tell me the biggest
disadvantages of java so that I know where I will get the problems and where
the bottlenecks are?

Thanks in advantage,
_______________________________________
Martin Wildam

mailto:[email protected]
http://www.may.co.at
 
N

Neal Gafter

Martin said:
as I am about to switch to java, can somebody tell me the biggest
disadvantages of java so that I know where I will get the problems and where
the bottlenecks are?

Disadvantages compared to what? Compared to a spoon, it is much harder to use.
 
M

Michael Borgwardt

Martin said:
Sorry, I am currently using VB under Windows.

Then the main disadvantage is that a Java program requires a Java runtime
to run, and Windows does not necessarily come with one preinstalled
(especially not an up-to-date one).

Furthermore, many tasks that are trivial in VB (GUIs and DB access) are
seemingly complex in Java, which is mainly because Java is more general
and can do all kinds of stuff that are very difficult or impossible in VB.
 
L

Lance Parkington

I'm not sure whether this is helpful but recently switched from
Smalltalk to Java and encountered the following problems immediately
involving basic everyday matters. Most of the classes appear to be 99%
there for expected behaviour but the 1% remaining may need some time
to master!

1) Found multiple data types for what might be expected to be
primitive objects confusing (eg int,Integer,
double,java.langDouble)not always obvious which to use (eg int or
Integer?) and supporting methods subtley different (eg not all int
methods supported by Integer)
2) String/number type cast (required for manipulating String data
collected in GUI for processing in methods) (eg requiring
Integer.parseInt() or similar code Double.parseDouble() and if
dependent on user typing in some text in a text field even simple
error handling nontrivial )
3) Collection handling a little awkward (after Smalltalk) requiring
full set of operations for class casting, get methods, iterators etc
for both basic and advanced processing of elements. Had trouble adding
ints to ArrayLists. Order of addition preserved only by ArrayList and
LinkedList. TreeList sorts elements as added to list which may not
always be required. Difficult to extend/change collection behaviour
without crashing/unexpected behaviour resulting . Dictionary/Hashmap
type collections with several nesting required quite lengthy
statements for initialisation/iteration.
4) GUI builders (eg VisualAge) easy to use but editing GUI for clients
several months into software development cycle usually requires
original IDE and difficult to maintain long .java files. If there are
import/export problems (as sometimes happens) with the IDE there is
real trouble!
5) Writing text to files determining whether to put newlines using
Strings "\n" or "\n" + "\r" or "\r" + "\n" or "\r" to get formatted
text readable by Microsoft Notepad using simple buffered writers
6) Basic GUI component JList does not have scrolling support as
standard so only useful for short lists unless adding JScrollPanes.
Once selected item in list second click does not deselect list
resulting in GUI cannot be reset to initialised state (ie list item
not selected).
 
M

Mladen Adamovic

Ferro said:
Java is slow!
The other side of the moon is portability!

I agree.
Other my opinions:
- class library in Java is very complicated and a bit buggy (i.e. Swing)
The other side of the moon is Java have very powerful class library.
 
G

Gary Labowitz

Martin Wildam said:
Hi folks,

as I am about to switch to java, can somebody tell me the biggest
disadvantages of java so that I know where I will get the problems and where
the bottlenecks are?

I can only point out the things that are the most difficult for most of my
students:

1. Understanding the concept of passing by value. (And stop saying "I pass
an object" until you really know what is happening.)
2. Understanding that only variables are passed from method to method.
3. Understanding reference variables and not getting confusion between
reference variables and objects.
4. Understanding casting, particularly of reference variables. This is
probably the most difficult concept.
5. Learning the way classes are located for syntax checking at compile time
and loading at runtime.
6. Understanding how "callbacks" are used in Java. This involves listeners
being "well known names" that a caller identifies as callback code.
7. Forgetting about how the language you are currently using does things;
getting rid of the assumptions you are used to making.
8. Learning to read the documentation.
9. Graphics are difficult until you understand points 4, 6, and 8.
10. Understanding why you need an up-to-date runtime. Getting it installed,
i.e. talking people into installing it when they don't have one. The one
Microsoft used to provide doesn't count.
11. Understanding access modifier rules.
12. Understanding threading and synchronization.

The simple points:

1. There are only nine kinds of variables. They all have exactly defined
properties.
2. There are so many classes already implemented that you don't have to
reinvent many wheels. It's like a gigantic Tinkertoy set with which you can
build just about everything.
3. You CAN just about run anywhere (that has a runtime installed).

It looks like a lot of negatives, but it is such a powerful system once
these details are understood and one learns how to manipulate it that I
think it is worth it.
Now if only Sun doesn't drop the ball while distracted with other things --
like staying solvent.
 
J

Joona I Palaste

I can only point out the things that are the most difficult for most of my
students:
1. Understanding the concept of passing by value. (And stop saying "I pass
an object" until you really know what is happening.)
2. Understanding that only variables are passed from method to method.

Not "variables" - "values". For example:

public class Foo {
}
public class Bar {
public Foo getFoo() {
return new Foo();
}
}
public class Baz {
public void useFoo(Foo foo) {
}
}

Now the code:
new Baz().useFoo(new Bar().getFoo());
passes a value of type "reference to a Foo" to the useFoo() method in
Baz. But this value is not stored in any variable.
The simple points:
1. There are only nine kinds of variables. They all have exactly defined
properties.

I.e. primitive types, references and array references?
 
T

Thomas G. Marshall

Mladen Adamovic said:
I agree.
Other my opinions:
- class library in Java is very complicated and a bit buggy (i.e.
Swing) The other side of the moon is Java have very powerful class
library.

I /mostly/ agree.

"Java is fast" does seem to be a load of hype, much to my bitter
disapointment through the years. :(! :(! :(! I've done amazing things with
it, but no it isn't fast. And no, that is /not/ because I don't know how to
program properly.

I disagree that java is complicated. I very much like the class library,
and don't find swing buggy, since 1.3 or so.
 
R

Roedy Green

"Java is fast" does seem to be a load of hype, much to my bitter
disapointment through the years. :

Why don't you just have a look at what Java is like natively compiled?

See http://mindprod.com/jgloss/nativecompiler.html

THEN perhaps you can speak with some authority on whether Java the
LANGUAGE is slow, rather than some particular combination of out of
date hardware and software.
 
T

Thomas G. Marshall

Roedy Green said:
On Wed, 22 Oct 2003 16:50:17 GMT, "Thomas G. Marshall"



Why don't you just have a look at what Java is like natively compiled?

If you natively compile java, then you have broken java's wora paradigm.
"Java" proper is a platform, not just a language.

When people are complaining about java, they are talking about java compiled
to byte codes running on a jvm, not some 3rd party native compilation.

See http://mindprod.com/jgloss/nativecompiler.html

THEN perhaps you can speak with some authority

I've been contracted to develop large scale java applications since just
before java 1.0, so I ought to have plenty of "authority".

on whether Java the
LANGUAGE is slow, rather than some particular combination of out of
date hardware and software.

Hardware???? What's that supposed to mean? You pick the hardware, and C++
will outperform java tremendously. And I am enthralled with Java and /hate/
C++ by the way.
 
R

Roedy Green

If you natively compile java, then you have broken java's wora paradigm.
"Java" proper is a platform, not just a language.

You could do it moving the responsibility for native compilation from
the developer to the consumer. I have suggested to the Jet people
they should try to market their compiler for this purpose. The catch
is , the free version is quite suited for that. You can natively
compile from any Jar or set of class files. You don't have to be the
developer!

I think I read somewhere that someone had natively compiled Eclipse.
 
V

VisionSet

Joona I Palaste said:
Gary Labowitz <[email protected]> scribbled the following:


I.e. primitive types, references and array references?

ie primitive types, object references

But what the hell are the nine?!
All the individual primitives? If so that isn't a simple point as there are
simple rules that govern there relationships.
 
G

Gary Labowitz

Joona I Palaste said:
Not "variables" - "values". For example:

Correct. Okay.
I.e. primitive types, references and array references?

Please give example of array references. I only meant the eight primitives
and references.
 
G

Gary Labowitz

VisionSet said:
ie primitive types, object references

But what the hell are the nine?!

byte, short, int, long, float, double, char, boolean, reference variable.

Is there another?
 
J

Joona I Palaste

Please give example of array references. I only meant the eight primitives
and references.

An array reference is simply a reference to an array. For example:
int[] a;
Object[] b;
a and b are array references. I count them separately from object
references because they support the [] operator, which object references
do not.

--
/-- Joona Palaste ([email protected]) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"And according to Occam's Toothbrush, we only need to optimise the most frequent
instructions."
- Teemu Kerola
 
D

Daniel Dyer

4) GUI builders (eg VisualAge) easy to use but editing GUI for clients
several months into software development cycle usually requires
original IDE and difficult to maintain long .java files. If there are
import/export problems (as sometimes happens) with the IDE there is
real trouble!

I agree, which is why most Java GUI developers would recommend that you
don't use a GUI builder. It may have a steeper learning curve to start
with but it pays off in the long term.
5) Writing text to files determining whether to put newlines using
Strings "\n" or "\n" + "\r" or "\r" + "\n" or "\r" to get formatted
text readable by Microsoft Notepad using simple buffered writers

This seems to be more a criticism of Notepad than Java. Most editors will
display text files OK whether you are using UNIX or DOS line-endings.
6) Basic GUI component JList does not have scrolling support as
standard so only useful for short lists unless adding JScrollPanes.
Once selected item in list second click does not deselect list
resulting in GUI cannot be reset to initialised state (ie list item
not selected).

I'm not sure I understand why this is a problem. None of the GUI
components support scrolling directly but all can be added to a
scrollpane. Seems like a reasonably good solution to me.

Your other points I agree with.

Dan.
 
B

Bent C Dalager

4) GUI builders (eg VisualAge) easy to use but editing GUI for clients
several months into software development cycle usually requires
original IDE and difficult to maintain long .java files. If there are
import/export problems (as sometimes happens) with the IDE there is
real trouble!

We use JBuilder, which creates GUI initialization code that is
maintainable without the IDE. I never really understood why people
would want to use a GUI builder which builds code that only itself
understands and/or that the programmer isn't allowed to touch.
6) Basic GUI component JList does not have scrolling support as
standard so only useful for short lists unless adding JScrollPanes.

Well, but then that's rather the point.

Text areas don't support line wrapping text either, unless you call
JTextArea's setLineWrap() method.

I guess I just don't understand your objection.
Once selected item in list second click does not deselect list
resulting in GUI cannot be reset to initialised state (ie list item
not selected).

This is standard behaviour. You need to use ctrl-click to unselect.
While obscure, it's unfortunately how it's supposed to work.

Cheers
Bent D
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top