What's bad in Java

J

Jack

.. Java programs are slower (Swing and JVM)
.. Swing layouts are not efficient to get desired result
.. There is a memory footprint overhead (compared to primitive sizes)
.. The GC freezes the application from time to time
.. It's impossible to add a method to a JDK class
.. The difference between checked and unchecked exception
.. Collections class are badly designed, they try to do too much
.. Starting thread is easy but synchronizing results in the GUI is harder
.. Having to code methods to access fields is dumb, it should be
"transparent"
.. The JDK gives access to a ridiculously small part of an OS features
.. It's not possible to free memory when i'm sure i wont use it again

I hope the next release will address these concerns.
 
E

Evans

Jack said:
. Java programs are slower (Swing and JVM)

Urban legend, imprecisely stated in flame-bait fashion.
. Swing layouts are not efficient to get desired result

Assertion requiring evidence.
. There is a memory footprint overhead (compared to primitive sizes)

What doest hat mean?
. The GC freezes the application from time to time

This happens sometimes. Of course, the application only freezes for a moment,
then resumes, and noticeable pauses in every case I've seen have been curable
with deployment policies; no recoding necessary. Lack of GC, OTOH, often
causes non-Java applications to freeze also, and those neither start up again,
nor get fixed without code changes.
. It's impossible to add a method to a JDK class

That's considered a bad thing?

Anyway, it has zero impact. The normal and best-practice idiom in any
platform for API code is to use the class, not extend it, unless, as in the
Java API, you are using one of the classes designed to be extended.

The truth is that the Java standard API contains a mix of classes intended for
subclassing and classes not intended for subclassing. The choice of which was
made by the API designer, and not necessarily for bad reasons. If there is a
valid criticism, it would be directed at specific library classes, along with
a rational explanation of why the API designer's decision was wrong, and why
it's easier and preferable to change the Java standard API than to write code
oneself.
. The difference between checked and unchecked exception

What about it? Are you saying that the fact that there is such a difference
is bad? Are you saying that something about how they differentiate the two is
bad? Should they be more different? Less? In what ways? Why?

Are you even clear what the difference is and what the different purposes of
the two are? What would you do instead, and how would you avoid failing those
purposes? Or would you abandon their purposes altogether? If so, what
advantage would that bring?
. Collections class are badly designed, they try to do too much

Rrrr? (Scooby-Doo noise.)

On the face of it, that's a singularly poorly-framed thesis. Are you
expecting a chorus of partisans to plaintively wail, "No, no! The collections
classes are works of beauty! We worship them!"?
. Starting thread is easy but synchronizing results in the GUI is harder

Luckily Java makes that situation easier than in most languages.

Concurrency is hard, folks. Inherently. Synchronization in any GUI is
harder. People who whine that it's hard probably aren't interesting in
putting in the effort to get it right.

This is not a Java problem. This is a
concurrency-is-hard-vs.-the-lazy-programmer problem, extant in every platform.
. Having to code methods to access fields is dumb, it should be
"transparent"

Very funny.

"Having to code methods to access fields" is not a feature of the Java
language. If people are doing that, it's because there are practical
advantages that they see to the idiom, not because the language requires it.

Whether they are correct or not is a separate question, and not anything for
which one can blame or praise the language.

"dumb" is not an engineering evaluation. Calling a variable "getFeature()"
instead of "feature" is only a few extra characters. Writing "setFeature(
value )" isn't all that much harder than writing "feature = value". Both
these idioms buy maintainability and flexibility at negligible cost.

Five or six extra characters typing to save hours of some hapless future
maintainer's or enhancer's time is hardly "dumb". That's assuming your IDE,
unlike mine, doesn't save you those keystrokes right back with auto-completion.

Anyway, it's up to you to use or not use the idiom. Most programmers use it,
simply because in their not-"dumb" thinking, it's worth it.
. The JDK gives access to a ridiculously small part of an OS features

Words like "ridiculously" are clearly designed to inflame rather than assert.
Put this in engineering terms, please.

In practice, Java and its API have caught on because many people find that
they provide enough to do what they need, and enough more than competing
platforms that they chose Java.

Free marketplaces of languages are more effective than religious wars to
determine "goodness" of a language. Many people choose LAMP with PHP over
Java as a web platform.
. It's not possible to free memory when i'm [sic] sure i [sic] wont use it again

That's not factual. It's not only possible, the JVM generously does that for you.
I hope the next release will address these concerns.

It won't. First of all, it's clear your goal is to flame, and I doubt anyone
inventing Java cares much about that. Secondly, you haven't really expressed
anything concrete that can be addressed. Things that are changing in Java,
such as speed (at which Java has for some time been roughly even with other
languages like C or C++) and GC, are being handled in ways that seem quite
effective. A couple of your comments, like "[t]he difference between checked
and unchecked exception", don't even express a criticism, so there's
nothing for the Java mavens to address.

Java is far from a perfect language or platform, but the valid criticisms are
pretty specific and technical. Words like "dumb" and "ridiculously" don't
give much handle for productive resolution. Recast in technical terms, with
precise terminology, and for Goddess's sake study the reasons why things are
the way they are before you start taking shots at them. Be careful when
presenting a laundry list like this; get one thing stupidly wrong and you will
cast aspersion on the validity of all your points, even if some of them are
worthy. If you convince people that you are a trollish putz, they will ignore
even your best advice.


Coincidentally, we have a talk scheduled later this month to discuss
some of the topics you outlined above.

Check here for the details
http://www.jroller.com/evans/entry/concurrency_and_performance

Evans
 
J

Jack

Lew a écrit :
> [a bunch of points]

It won't. First of all, it's clear your goal is to flame, and I doubt
anyone inventing Java cares much about that. Secondly, you haven't
really expressed anything concrete that can be addressed. Things that
are changing in Java, such as speed (at which Java has for some time
been roughly even with other languages like C or C++) and GC, are being
handled in ways that seem quite effective. A couple of your comments,
like "[t]he difference between checked and unchecked exception",
don't even express a criticism, so there's nothing for the Java mavens
to address.

Java is far from a perfect language or platform, but the valid
criticisms are pretty specific and technical. Words like "dumb" and
"ridiculously" don't give much handle for productive resolution. Recast
in technical terms, with precise terminology, and for Goddess's sake
study the reasons why things are the way they are before you start
taking shots at them. Be careful when presenting a laundry list like
this; get one thing stupidly wrong and you will cast aspersion on the
validity of all your points, even if some of them are worthy. If you
convince people that you are a trollish putz, they will ignore even your
best advice.


Thanks for reading. People who thinks its a trollish putz are wrong. My
aim was to see what other Java programmers might think about my points.
I think if nobody agrees about what are the problems in Java, the
language/JDK will never change. If it does not change, i hope another
programming language, some kind of sequel will replace it, with these
problems fixed. I hope that a lot...

I'm coding in Java for 3 years now, and i'm pretty sure that i'm right
about my points. They are concise ways of expressing my everyday
problems with Java, so i don't get you.

The guy who will say to me that using the Java ArrayList<Integer> is as
fast as using int[] in C is a liar. I just don't understand why people
want to believe Java is not slow. IT IS !!! It is because nobody write
Java code using C style primitive type.

I won't talk about memory, i think it's obvious.

Anyway, if somebody can give me hint on a programming language which
fixes the listed problems, well i would be glad.

And my last point will be that some language (like C# i think) offers a
solution to some points (the accessors), so i think i'm not the only one
to find writing accessors dumb.
 
E

Evans

Lew a écrit :
[a bunch of points]




It won't. First of all, it's clear your goal is to flame, and I doubt
anyone inventing Java cares much about that. Secondly, you haven't
really expressed anything concrete that can be addressed. Things that
are changing in Java, such as speed (at which Java has for some time
been roughly even with other languages like C or C++) and GC, are being
handled in ways that seem quite effective. A couple of your comments,
like "[t]he difference between checked and unchecked exception",
don't even express a criticism, so there's nothing for the Java mavens
to address.

Java is far from a perfect language or platform, but the valid
criticisms are pretty specific and technical. Words like "dumb" and
"ridiculously" don't give much handle for productive resolution. Recast
in technical terms, with precise terminology, and for Goddess's sake
study the reasons why things are the way they are before you start
taking shots at them. Be careful when presenting a laundry list like
this; get one thing stupidly wrong and you will cast aspersion on the
validity of all your points, even if some of them are worthy. If you
convince people that you are a trollish putz, they will ignore even your
best advice.

Thanks for reading. People who thinks its a trollish putz are wrong. My
aim was to see what other Java programmers might think about my points.
I think if nobody agrees about what are the problems in Java, the
language/JDK will never change. If it does not change, i hope another
programming language, some kind of sequel will replace it, with these
problems fixed. I hope that a lot...

I'm coding in Java for 3 years now, and i'm pretty sure that i'm right
about my points. They are concise ways of expressing my everyday
problems with Java, so i don't get you.

The guy who will say to me that using the Java ArrayList<Integer> is as
fast as using int[] in C is a liar. I just don't understand why people
want to believe Java is not slow. IT IS !!! It is because nobody write
Java code using C style primitive type.

I won't talk about memory, i think it's obvious.

Anyway, if somebody can give me hint on a programming language which
fixes the listed problems, well i would be glad.

And my last point will be that some language (like C# i think) offers a
solution to some points (the accessors), so i think i'm not the only one
to find writing accessors dumb.


In as much as I use Java as my main development language, I also
develop in Python. In fact, I've been very happy using it in the last
6 years and have no complains whatsoever.

If you'd like to try out a very expressive and sexy language, then do
yourself a favour and try Python.


Evans
http://www.jroller.com/evans/entry/concurrency_and_performance
 
J

Jack

Lew a écrit :
Jack said:
The guy who will say to me that using the Java ArrayList<Integer> is
as fast as using int[] in C is a liar. I just don't understand why people

i was expressing some facts : average Java applications uses so called
high level data structure wich have a high overload cost in memory and CPU.
Apples and oranges. What about comparing int [] ops in Java vs. C?

For similar operations in real-world applications, Java is generally
about as fast as C for most things. It's not really worth arguing here;
such discussions rarely work from fact or resolve in Usenet. Let those
who care review the evidence.

Note that I do not claim that Java is quite as fast as C, nor that it
applies across the board to all use cases. Furthermore, having used
both C and C++ myself for some years, I remain convinced that different
tools work better for different jobs. Java is not the perfect language.

Well i agree, but this assumption would make Java a student-assignment
language, not a highly responsive desktop application.
Them's strong words, pahdner. Better back it up with facts. The facts
that I've seen, combined with my own (misleading) micro-benchmarks
indicate that Java is really quite nearly in the league of C and such
languages.

Shouting does not prove a point. Evidence supports a point. I note
your repeated exclamation points, and reject them as evidentiary.

Ok so now you are the trolling guy since, like always, every single
arguments i give is cut and rejected. My point is that when you start an
average Java application, it's less reactive, or slower, than an average
C application. If you compare Notepad with the Java demo which is in the
JDK (i believe), you see it right away.

You want rational point, but you won't listen to them, you just won't
admit them, you want to fight the evidence.

I know Java is not the perfect language, but it sacrifices too much of
speed for easiness, from my work experience.

I won't talk about memory, i [sic] think it's obvious.

You think what's obvious? Your earlier post said that Java wouldn't let
you free memory when you were done with it. That is not accurate; Java
most certainly does let that happen. If you have another point about
memory, please let us know what it is.

You seems to make a difference now, between "let that happen" and "let
you make it happen". I mean, in C, i can release memory when i want to.
Anyway, if somebody can give me hint on a programming language which
fixes the listed problems, well i would be glad.
Java.
And my last point will be that some language (like C# i [sic] think)
offers a solution to some points (the accessors), so i [sic] think i'm
[sic[ not the only one to find writing accessors dumb.

What does "dumb" mean?

Do i need to find the exact word to make my point ? Don't you have
yourself any grief against writing "mutators", with self Javadocs, and
with one dummy statement ? I mean, haven't you find yourself writing
them and thinking, what a dumb think to do, but you have to, since all
the dev team do it...

Java does not require you to write accessors, so don't, if you hate them
that much.

Take a car and push it, if you don't like the oil industry. Using half
the language means:
1/ You code alone
2/ You use the wrong language
Meanwhile its way of doing accessors and mutators is perfectly
serviceable. It may not be your personal favorite, but labeling the
idiom "dumb" by some unspoken, emotional and personal aesthetic is an
expression of your psychology, not a criticism of Java.

Unspoken is true, but i wanted to avoid "i think that" followed by "not
me". I'm pretty sure you may find drawbacks too, but you want me to list
them precisely, which i won't.

There are many people who object to things they do not understand. It
is not always the fault of the thing. Pointing to a neighbor who says,
"I hate that, too. It's dumb!" doesn't make it so. Logic and reason,
please.

Every rational thought call another rational thought wich claim the
opposite, so i won't do it again (like for the Java slowness point). I
just feel that Java application are slower, in average. I might start a
thesis, putting some time measure on 5 Java application, and 5 C
application, but it would be useless since it's obvious.

Anyway, thank you for answering. But it seems we won't agree on anything.
 
R

Roedy Green

. Java programs are slower (Swing and JVM)
. Swing layouts are not efficient to get desired result
. There is a memory footprint overhead (compared to primitive sizes)
. The GC freezes the application from time to time
. It's impossible to add a method to a JDK class
. The difference between checked and unchecked exception
. Collections class are badly designed, they try to do too much
. Starting thread is easy but synchronizing results in the GUI is harder
. Having to code methods to access fields is dumb, it should be
"transparent"
. The JDK gives access to a ridiculously small part of an OS features
. It's not possible to free memory when i'm sure i wont use it again

I hope the next release will address these concerns.


This sounds like something you copied from another place. It sounds
like flame bait more than a discussion of where Java should be headed.
. Java programs are slower (Swing and JVM)
Jet produces code better than hand coded assembler. Where is your
benchmark?
. There is a memory footprint overhead (compared to primitive sizes)
primitives take the same space they take in C.
. It's impossible to add a method to a JDK class
You can add a method to a Java class by subclassing or if you were
really determined, with a class file editor to add it to the original
class.
. The GC freezes the application from time to time
There are many techniques of GC. Some have pauses. Some do not. Even
ones that do, have shorter pauses than the bad old days.
. Swing layouts are not efficient to get desired result
compared to what? X-windows? What else even attempts to do GUI in a
platform-independent way?
. The difference between checked and unchecked exception
The difference between checked and unchecked exception. Please give
your arguments for making all exception checked or all unchecked. I
think the current scheme makes more sense than either.
. Starting thread is easy but synchronizing results in the GUI is harder
I agree the gobblegook you need to deal with Swing being single thread
is barfy. The alternative would be to have the sync built into every
swing method, slowing things down for single thread apps. We
definitely need some syntactic sugar here. However that is a Swing
design problem, nothing wrong with Java itself.
. The JDK gives access to a ridiculously small part of an OS features
It gives you pretty well everything that is multiplatform. For
anything platform-specific, you need JNI. What is missing? People
usually complain the libraries are too extensive, too much to learn
I hope the next release will address these concerns.
Not bloody likely. Your goal is to see Java abandoned.
 
J

Jack

Razii a écrit :
Java SE 6 Update 10 includes

https://jdk6.dev.java.net/6u10ea.html

"hardware acceleration support: Java SE 6 Update 10 introduces a fully
hardware accelerated graphics pipeline based on the Microsoft Direct3D
9 API, translating into improved rendering of Swing applications which
rely on translucency, gradients, arbitrary transformations, and other
more advanced 2D operations."

As far as I know, the hardware acceleration support won't be used for
default 'Metal' and 'Ocean' but will work with the new 'Nimbus' look
and feel (which won't be default due to backward compatibility
issues).

Great ! at last.

Don't use it. Use third-party tools, such as QT Jambi. See demo:

http://dist.trolltech.com/developer/download/webstart/index.html



Don't use it then. If you want to use primitives in Collections, use
third party libraries like Trove

http://trove4j.sourceforge.net/

It's true, but isn't this a problem ? When you have to change the base
library to get what you want, it means that the JDK is problematic.

From my everyday work, i would have to convince my boss to change
everything in source code, to gain some responsiveness, while he doesn't
see the point of doing that.

I've never claim that you cannot find an acceptable workaround for every
problem in Java (optimization for CPU/memory, third party library for
missing features), i just think it's time to modify Java to transform
these workaround in fully integrated fixes.

It's like when you talk with an OSI engineer, and he says to you TCP/IP
is slow because there are too much layers. Well it's similar for Java,
since the language "features" encapsulation, you just don't know what's
going on. It's just bad, it's like saying to bakers "just put the flour
in the big machine and will get what you want".

In fact, instead of adding more features to Java, i would prefer
removing most of "badly designed"/ineffective stuff and open the
language enough for 2 things:
- have more insights and control on what is going on (delete/free for
memory, no more accessors)
- a way to add things more easily (modifying some behavior in the "new" JDK)
 
J

Jack

RedGrittyBrick a écrit :
Surely there are no OSI engineers, only ex-OSI engineers?



Eh? OSI has 7 layers, TCP/IP has 4 layers.

No wonder OSI died, it lacked numerate engineers?

Ok, you are being smart... I should have said, that one engineers told
me that TCP/IP was slow because it has too many layers. Now i've said
OSI instead because saying "TCP/IP" is slow would have brought a bunch
of geeks saying "but in Linux x.x.x, the TCP stack was optimized, again..."
 
A

Arved Sandstrom

[ SNIP ]
Thanks for reading. People who thinks its a trollish putz are wrong. My
aim was to see what other Java programmers might think about my points. I
think if nobody agrees about what are the problems in Java, the
language/JDK will never change. If it does not change, i hope another
programming language, some kind of sequel will replace it, with these
problems fixed. I hope that a lot...

I'm coding in Java for 3 years now, and i'm pretty sure that i'm right
about my points. They are concise ways of expressing my everyday problems
with Java, so i don't get you.

I can accept that you think you are right about your points. It doesn't
necessarily mean that you are. I have similar criticisms about a bunch of
languages, Java included, but I'm not convinced I am right about all of
them.
The guy who will say to me that using the Java ArrayList<Integer> is as
fast as using int[] in C is a liar. I just don't understand why people
want to believe Java is not slow. IT IS !!! It is because nobody write
Java code using C style primitive type.

Point being, to use your example, you're using ArrayList<Integer> because it
gives you type safety, it has a hell of a lot of useful methods, it's doing
bounds checking...and so forth. Once it's compiled to byte code, and then
further processed by a JIT, you're looking at efficient code. You will not
do better in C unless you (as the programmer) can guarantee that your
accesses to an int[] array are not out of bounds, and that your values
really are ints.
I won't talk about memory, i think it's obvious.

Well, no, it's not obvious. If you're using a Java object it's because you
require an object. If the member fields are a double, two Strings, and a
reference to another object, and there are 10 methods in the class that the
object is an instance of, I can't honestly think of a way in which you'll
write code in C that is going to lessen memory requirements over Java -
you'll still have a struct variable, you'll have a double variable, storage
for two char arrays, and you'll have 10 functions implemented somewhere that
deal with that kind of struct.
Anyway, if somebody can give me hint on a programming language which fixes
the listed problems, well i would be glad.

And my last point will be that some language (like C# i think) offers a
solution to some points (the accessors), so i think i'm not the only one
to find writing accessors dumb.

So in C# you have a private string called "name". You write (optionally) get
and set accessors, with a property called Name (say), so that you can do
obj.Name or obj.Name = ...

This is a major improvement over Java how, exactly? In Java you'd have a
private String called name, you'd write (optionally) getName and setName
methods (using the conventions for naming), and you'd do obj.getName() or
obj.setName(value).

In dynamic languages you can in fact shorten the code enormously. But
fundamentally you still write accessor code. In some situations less of it,
in some situations just as much. If you look at the canonical code from
perltoot (http://perldoc.perl.org/perltoot.html), you might have

sub name {
my $self = shift;
if (@_) { $self->{NAME} = shift }
return $self->{NAME};
}

so that you can go (for the getter)

$person->name;

or (for the setter)

$person->name("Arved");

You changed the overall situation how much, using Perl? Not very much is the
answer. Ruby (arguably) is about as short as it gets, with attr_reader,
attr_writer and attr_accessor, but the overall gain in less code is what?
One percent? Three percent?

AHS
 
A

Arved Sandstrom

Jack said:
Razii a écrit : [ SNIP ]
Don't use it then. If you want to use primitives in Collections, use
third party libraries like Trove

http://trove4j.sourceforge.net/

It's true, but isn't this a problem ? When you have to change the base
library to get what you want, it means that the JDK is problematic.

No, it means that the JDK has APIs which represent the general solution to
general needs for programmers using a general-purpose language.
From my everyday work, i would have to convince my boss to change
everything in source code, to gain some responsiveness, while he doesn't
see the point of doing that.

Well, maybe your boss has a point. In my experience bosses complain loudly,
frequently and vociferously about application responsiveness (not
infrequently while not giving a damn about program reliability), so if he or
she doesn't see an issue, either your boss hasn't used the app much yet, or
you're over-engineering.
I've never claim that you cannot find an acceptable workaround for every
problem in Java (optimization for CPU/memory, third party library for
missing features), i just think it's time to modify Java to transform
these workaround in fully integrated fixes.

It's like when you talk with an OSI engineer, and he says to you TCP/IP is
slow because there are too much layers. Well it's similar for Java, since
the language "features" encapsulation, you just don't know what's going
on. It's just bad, it's like saying to bakers "just put the flour in the
big machine and will get what you want".

How does encapsulation prevent you knowing from what's going on? The source
code is available for the JDK, after all. How is there more visibility in C
or C++ or FORTRAN, for example? If you are using libtiff, for example, do
you complain that you don't know what's going on when you call a function in
that library?

It sounds to me more like you just aren't a big fan of OOP. That's fair
enough, use different languages then.
In fact, instead of adding more features to Java, i would prefer removing
most of "badly designed"/ineffective stuff and open the language enough
for 2 things:
- have more insights and control on what is going on (delete/free for
memory, no more accessors)

To the latter point: "no more accessors". There are no language-mandated
accessors in Java. If you like you can declare object fields as public,
access them like obj.field, and you can't get more basic than that. Not
recommended, but you can do it. Even in C, if you were using structs, you'd
still have to write myStruct.x or myStruct->x.

When using the recommended approach of writing accessor methods (not
willy-nilly, but only as needed), you're not doing things any differently in
Java than you would in any other similar language.

As for delete/free for memory, you've got to be kidding. The situations
where you want to have explicit control over memory allocation are few and
far between. I can't remember the last time where I *wanted* to do it.
- a way to add things more easily (modifying some behavior in the "new"
JDK)

If you mean stuff like extension methods or partial classes in C#, I sort of
agree. Used with care I like these features, where appropriate.

AHS
 
J

Joshua Cranmer

Jack said:
. Java programs are slower (Swing and JVM)
Not really. See any of the last, oh, half-dozen "JAVA IS SO
SLOW!!!!!!!111111" threads.
. The GC freezes the application from time to time

In my experience, this "freeze" is unnoticeable.
. It's impossible to add a method to a JDK class

And this is bad because...? The only language I know of that can do this
off the top of my head is JavaScript, and its usage there seems to be
about zero.
. The difference between checked and unchecked exception

I have not seen any experienced Java programmer advocate the removal of
this feature (the closest I've seen is to make it a compiler option).
IMHO, it is one of the best things about Java, since you actually know
which exceptions can fire. Better than some other languages where I'm
wallowing down a call-hierarchy ten functions deep trying to figure out
what it can throw.
. Collections class are badly designed, they try to do too much

Then I take it you abhor the STL.
. Starting thread is easy but synchronizing results in the GUI is harder

Multithreading is orders of magnitudes easier than in other languages.
. Having to code methods to access fields is dumb, it should be
"transparent"

You've probably designed something wrong, then. Field getters/setters
should be at a minimum, and, even then, having methods makes it easier
to encapsulate so that you can change your implementation later on.
. The JDK gives access to a ridiculously small part of an OS features

i.e., "I only program on Windows, who cares about cross-platform
reliability?"
. It's not possible to free memory when i'm sure i wont use it again

Setting the only reference of a large memory object to null should do it.

In short, flamebait from a neophyte Java programmer who can't even place
himself in a Java programming frame of mind. Java is not C#, C++,
JavaScript, Python, Perl, PHP, FORTRAN, COBOL, or assembly. It is a
complete language, one that has inspired derivatives, and as such,
requires its separate programming reference frame.
 
S

steph

Jack said:
.. Java programs are slower (Swing and JVM)
.. Swing layouts are not efficient to get desired result
.. There is a memory footprint overhead (compared to primitive sizes)
.. The GC freezes the application from time to time
.. It's impossible to add a method to a JDK class
.. The difference between checked and unchecked exception
.. Collections class are badly designed, they try to do too much
.. Starting thread is easy but synchronizing results in the GUI is harder
.. Having to code methods to access fields is dumb, it should be
"transparent"
.. The JDK gives access to a ridiculously small part of an OS features
.. It's not possible to free memory when i'm sure i wont use it again

I hope the next release will address these concerns.

If you failed producing something that works, don't blame the language.

Moreover, trolls are protected specie, don't disturb them.
 
M

Mike Schilling

Jack said:
It's like when you talk with an OSI engineer, and he says to you
TCP/IP is slow because there are too much layers. Well it's similar
for Java,
since the language "features" encapsulation, you just don't know
what's going on. It's just bad, it's like saying to bakers "just put
the flour in the big machine and will get what you want".


If you don't understand the advantages of encapsulation (e.g. that it
makes large projects possible), I hope your influsence on the future
of Java is extremely limited.
 
M

Martin Gregorie

It's like when you talk with an OSI engineer, and he says to you TCP/IP
is slow because there are too much layers.
You have that backwards. OSI uses a seven layer model. TCP/IP
uses a four layer model which approximates the lowest 5 OSI layers.

TCP/IP provides no equivalent to the Presentation and Application layers,
which are approximated by application-specific protocols, such as FTP,
HTTP or SMTP. These are NOT part of the TCP/IP stack and are best thought
of as a combination of about half the OSI Application layer and the
application that would sit on top of it.

If you're going to attempt criticism, you should at least get your
facts right before you start.
 
M

Mike Schilling

Martin said:
You have that backwards. OSI uses a seven layer model. TCP/IP
uses a four layer model which approximates the lowest 5 OSI layers.

TCP/IP provides no equivalent to the Presentation and Application
layers, which are approximated by application-specific protocols,
such as FTP, HTTP or SMTP. These are NOT part of the TCP/IP stack
and
are best thought of as a combination of about half the OSI
Application layer and the application that would sit on top of it.

If you're going to attempt criticism, you should at least get your
facts right before you start.

About 1985 or so, I started (but never had the chance to finish) a
very amusing book written by a TCP expert (perhaps one of its
designers) about OSI, how badly overdosing it was, and how it was
destined to be a colossal failure. The author was entirely correct,
of course, and the amount of money DEC sunk into making Decnet
OSI-compliant was a terrific demonstration of how badly they
misunderstood the market towards the end. If anyone recognizes this
description and can name the book, I'd be grateful.
 
E

EJP

Jack said:
. Java programs are slower (Swing and JVM)

Compared to what?
. Swing layouts are not efficient to get desired result

Compared to what?
. There is a memory footprint overhead (compared to primitive sizes)

Rubbish. The memory overhead of primitive types in Java is zero. There
are *other* ways to represent values, such as Integer, BigInteger,
BigDecimal, each of which adds considerable *value* to the primitive
type, which also have an overhead, but nobody is forcing you to use
them. This is an apples-and-oranges comparison.
. The GC freezes the application from time to time

I haven't seen that since about 1998.
. It's impossible to add a method to a JDK class

Good. Same applies to C++ library classes actually, and a few other
languages I can think of.
. The difference between checked and unchecked exception

Also good. One of the best features of Java IMHO.
. Collections class are badly designed, they try to do too much

Badly designed compared to what? Too much of what?
. Starting thread is easy but synchronizing results in the GUI is harder

First part is good. 2nd part is true of any language, it's not a
language issue.
. Having to code methods to access fields is dumb, it should be
"transparent"

Java doesn't require you do that. It provides an access model which can
use to enforce that, *if* you so desire. C++ and most other OO languages
do that too.
. The JDK gives access to a ridiculously small part of an OS features

By design and intent. Features I haven't missed in eleven years.
. It's not possible to free memory when i'm sure i wont use it again

Untrue. The JVM even does it when you're *not* sure, because it can know
better than you do.
I hope the next release will address these concerns.

It won't, in any of these respects.
> Anyway, if somebody can give me hint on a programming language which
fixes the listed problems, well i would be glad.

'If you want Fortran you know where to find it.' (Dennis Ritchie)
> one engineers told me that TCP/IP was slow because it has too many layers

Same comments. Slow compared to what? Too many layers compared to what?
How does having too many layers make it slow?

This is all just balderdash frankly. TCP/IP is about as fast as it can
get, *given its design constraints and intentions,* which are not shared
by any of the obvious alternatives such as the *4* transport layers in
OSI, *all* of which are obsolete, while TCP/IP is *not*, curiously enough.
 
J

John

EJP a écrit :
Compared to what?


Compared to what?


Rubbish. The memory overhead of primitive types in Java is zero. There
are *other* ways to represent values, such as Integer, BigInteger,
BigDecimal, each of which adds considerable *value* to the primitive
type, which also have an overhead, but nobody is forcing you to use
them. This is an apples-and-oranges comparison.

Well, let's take a HasMap of Integer (key and value), if you put 1000
couple (key, value) in it, their is a big overhead that you can measures
comparing the 1000 * (4 + 4) data size.

I haven't seen that since about 1998.


Good. Same applies to C++ library classes actually, and a few other
languages I can think of.

I'm not talking about a general way, i just wish to see an intrusive way
to modify the JDK, wich could be added in Java next release.
Also good. One of the best features of Java IMHO.

A lot of peapole complains about that feature.
Badly designed compared to what? Too much of what?

They are heavyweighted for my uses, and i think i have standard uses of
them.
First part is good. 2nd part is true of any language, it's not a
language issue.

So explain why a library like "spin" was designed ?

Java doesn't require you do that. It provides an access model which can
use to enforce that, *if* you so desire. C++ and most other OO languages
do that too.

True, but if you are in a big dev team, you can't act as if you were
alone. I'm talking about generaly admitted best practices.
By design and intent. Features I haven't missed in eleven years.

Well i've already missed some statictics on File for example.
Untrue. The JVM even does it when you're *not* sure, because it can know
better than you do.

If you accept the idea of freeze, it's true. But take a look at bug:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4724038

Sun has provided a way to release shared memory because of security
concern, so you are stuck with workarounds to make the GC do it for you.

Most of the time, the GC is a good tool, but the cases where it is not,
the way to bypass it is needed.
 

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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top