That's an excellent point.
To the spirit of the thread, and from my experience working in
reasonably diverse range of languages, I still don't believe Java's
popularity has in any way, shape or form been a byproduct of its
legendary performance. I think in many cases the overhead incurred to
run a JVM is acceptable because of the functionality the code base
provides.
So winding back a bit, the reason that functionality can exist with
Java has much to do with the language/environment which frees
programmers from a lot of resource management and allows them to focus
more on plugging together components. Time to market and all that
jazz.
Like a lot of interpreted languages, Java's development cycle is
pretty excellent I think. A programmer can get a fairly complicated
application off the ground quickly due to a number of things brought
about both by the interp-language development paradigm that allows for
immediate detection of errors and compile-and-test-as-you-code
sessions.
I think those are the kinds of things which has made Java popular.
The performance issues are the trade off -- I find most Java-only
coders will explain away any performance issues by pointing out all
the great things you get in return, or how in controlled or specific
circumstances modern JVMs can use environment-specific knowledge to
coerce code into a better behaving form.
And don't forget about the very fact that with JVM,
you have to load the entire JVM to run a 2+2 program
and that magnifies the size of a 1 meg program by the
factors of magnitude. Before your main() is hit,
it already swallowed at least 10 megs, and for what?
Secondly, there is no mechanism allowing users to run
the application in native mode, so, to deliver a 1 megs
app, you need to include at least 5 more megs of JVM
and convince users that they MUST install that JVM,
otherwise they won't even be able to run your app.
I wish there was a native mode support, where java
app is compiled without JVM, which is also a bloatware.
You should be able to deliver you app in .exe format
where user simply souble clicks on it and it runs,
and there is no need to carry another 10 megs of its fat.
Vast majority of systems out there are windows based.
Third, java has too many layers of abstraction, which,
in turn, translates into pointer pointing to pointers,
pointing to yet more pointers, which can not possibly
translate into the equivalent performance.
All these layers are also a load on the developer
as you can not possibly do the simpliest things
in a most direct way. Especially for the people that
are new to java, it becomes just a royal pain on the
neck. If you hit that help key expecting to get a
simple answer on your simple problem, you'd have to
go thru several layers of abstraction and, therefore,
learn a lot of those things, you don't need at the moment.
And this is so pervasive, that there is basically exists
no aspect of java where things are kept simple.
Yes, it does provide for more universality, but some
things look like an overkill by factors of magnitude.
Another thing is the very lexicon of language.
Those things that people know for many years and
clearly understand the meaning of, are all renamed.
GUI elements are called components and containers,
and just about everywhere you look, you'd have to
deal with pretty non-intuitive concepts.
First of all, components and containers have no association
in human mind with GUI elements or structures.
Both of these rather associate with database type of ideas,
storage mechanisms, etc. When I first heard of "components"
and "containers", I had goose bumps, as I though they
are going to bring up the same thing as windows does,
a 5 layered set of complexities and an overkill by the
factors of magnitude.
And this goes to just about any common sense programming
issue. It is literally everywhere.
Another issue is this obscession with obsoleting things.
When you get the next version, you are pretty much
guaranteed that some things in your old code would
have to be rewritten to use the never version of the
same thing. I never heard of such issues with C/C++
code.
I like to compile code on the most detailed level
of warnings and, when program compiles with warnings,
I don't like it. When I hit that "build" key, just
about ALL I want to see, is a one line message:
Success.
As to graphical aspects of GUI design, to see people
telling you that about the best way to do it, is to
write a GUI code by hand is simply insane!
WHAT?
By HAND is the BEST way of writing a GUI code?
In Java?
I understand if it is an assembler, it is a different
story. In my entire experience with windows and C/C++,
I never even heard such a concept as writing gui
with my hex calculator.
And we are not talking about all the various versions of
layout managers. For what? And about the most powerful
of them, the gridbag, is screwed up in the most profound
sense of the word. Why?
Finally, just about every single "new" concept in java,
is what already existed in object oriented programming,
be it exceptions, events, file streams, stacks and
just about everything you can put your finger on.
Just about the only difference is that it is all wrapped
in a different package and named in just about the most
unintuitive way conceivable.
So... For you to write just about any realistically
complex app, you'd have to learn the entire thing,
and that can take years because of all those layers
upon layers upon layers of abstraction, that promise
you the way to a wonder world at the end. Meanwhile,
you'd have to sweat and waste days on the simpliest
concepts conceivable.
So, the learning curve is on the par with bloatware.
Another lil thing: can anyone imagine that standard
C/C++ code will become OBSOLETE with a new version
of compiler?
Never heard of such a thing.
File is a file and gui is just gui, knob is a knob
and text field is a text field.
Why should I abandon AWT?
It is just like abandoning some assembly level
instructions in your CPU. The reason Intel and
Microsoft gained a monster part of the market
is because even today, you can pull a program,
written a generation ago, and it will perfectly
run on the latest and gratest version of your
bloatware, be it in a DOS box.
The whole issue JVM needs to be looked at.
The fact that you need to load the whole thing
every time you run ANY app, is a monster size
overkill. It is like loading an operating system
just to output "hello" string on your terminal.
I'm fluent in a decent array of languages, compiled and interpreted,
as well as a good number of assembler languages. If it does nothing
else, it helps me to avoid falling madly in love with any one language
and making everything about it okay. The JVM and its mitigation
strategies are great, but it's not about that -- it's about Java's
ease of coding that's made it popular. Coding Java is like traveling
in a Winnebago, where coding C is like traveling on a dirt bike.
There are tradeoffs to both....
One other point related to Java on the downside IMO is a side effect
of exactly what's good about Java: ease of code reuse.
I have seen a lot of inefficiently written components used in a lot of
applications. Because Java encourages the programmer to let the JVM
handle a lot of details it seems to me -- and I welcome other opinion
on this -- that many Java coders get "lazy" about what's really going
on inside the code. If it's slow, they write it off as "there's a lot
going on." They seldom dig much below the surface, because that's
what Java seems to be trying to free you from having to do. It's
valuable in Java to make sure the appropriate techniques and objects
are used and to understand the implications of a bad choice -- refer
back to my 1st Java program, the "grep" implementation, to see what
wrong use/type of objects can do to runtime performance.
Java is popular partly (largely?) due to the ease with which you can
get an app going, but unless one is disciplined that very speed can
lead to less than optimal solutions. I'm certainly not suggesting
easier programming languages are bad, just thinking outloud with
respect to human nature.
Thoughts/experiences?
I wish the megawars between Sun, Microsoft and other major
players will eventually lead to a commonly accepted set
of standards, instead of sitting here, concerned that
with next version, you may not even have legal rights
to include the next version of their super-sexy
version of JVM or whatever they call it in the next
version of their bloatware.
The very fact that Microsoft does not support anything
beyond AWT, is about the worst news for the entire java
world.
I predict that in 2-3 years, Microsoft will obliterate
the whole java philosophy and mechanisms, and people
would not even see the word Java in documentation.
And they have ALL sorts of technologies developed,
time tested, and working perfectly well.
Never mind, it is called bloatware, or even monsterware,
as far as i can see. It is ALL bloatware, no matter
how you look at it. You either incur it this way,
or that. That is the whole difference.
When I read some articles regading the performance
issues and Java freaks even going as far as to claim
that java could be even MORE efficient that the native
mode programs, I could not believe my eyes.
What happened to their brains?
Have they all gone mad?
How this could POSSIBLY be, even in theory?
It is EXACTLY the same argument as to claim that
interpreter is more efficient than the compiled code,
just because it has some optimized primitives.
I, personally, do not even want to hear about
things like JVM. To me, it should be all hidden
and flexible enough not to carry factors of magnitude
more fat than I need. How can anyone in his clear mind
claim that C++ code is less efficient?
Then what is JVM?
How come for a program just to come up, you need to
wait for so long? How come my code carries the whole
universe of Java with the simpliest program,
where 90% of it is never even executed and simply
sits there eating your memory like a packman?
As I said before, and repeat it again, unless java
is wired into your hardware, which is probably
a generation in the future, I just don't see it becoming
that brick out of which any building is built.
Way too much overhead, WAY too much of unnecessary
complexity, way too many layers of abstration.
The things they wired into very language, could
be easily provided with off the shelf libraries
and efficiently compiled so that you only carry
those things your program refers to, and, in run
time, only those things you actually need,
are loaded, and loaded on demand.
To me, any good program should come up instantly.
It is a royal pain on the neck to even attempt
to start just about any major program out there
as you have to wait for minutes till you see
the main screen. By the time you see it,
look at your process monitor. You lost tens
and even hundreds of megs of memory, and you
didn't even BEGIN to do anything.
Bloatware?
Bloatware is a compliment.
It is rather a lunacyware.