Re: Help me!! Why java is so popular



On Feb 2, 11:31 am, "Jack Kielsmeier" <jackk...@xxxxxxxxxx> wrote:
<amalikarunanay...@xxxxxxxxx> wrote in message

news:1170433991.897057.314200@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

java has become an important language in very short time. What are
some of the things that have made it so popular?

One of the biggest reasons JAVA has taken off, is its ease of portability.
When an application is written in a language like C or C++, it must be
compiled separately for each platform that will run your application.

I think a big reason Java took off initially was the fact it's a C-
language derivative without pointers. Most of the Java programmers I
knew 10 years ago were disillusioned C/C++ people who found the memory
management tedious and error prone. The fact they could instantiate
and code and never clean up after themselves freed them to concentrate
on the problems they really wanted to expend their energy solving.

The reason people would get into Java coding today probably has little
to do with this and is due more to the language's large base of highly
functional classes that plug-n-play easily, so programmers can slam
dunk applications a lot easier. It's all about what's easy for us
(programmers), eh?


Java has a virtual machine that is able to take JAVA code information and
translate it to the specific machine running the application on the fly. It
makes it so you do not have to re-compile the application for every
platform.

Certainly true, though the same can be said for Perl and while it's
pretty popular, it's not as popular as Java. Partly that's due to Perl
being totally interpreted versus half-ways compiled (ie, byte code),
and let's face it, Perl isn't really a full-fledged programming
language.

The other thing that's perhaps a side effect from this paradigm is
that Java provides mostly least-common-denominator system services.
For instance, someone was asking me about checking for an already-
running instance of a program on a Windows workstation. That's a
really easy thing to implement in any language that can talk directly
to the OS -- about 15 lines of code invoking EnumWindows.

You can't do that in Java, however, unless you go JNI. That's not
necessarily a bad thing, however. You lose some OS-locale-based fine-
tuned features, but on the flip side when you grab someone's class
libs off a web site you have almost no work to do to use them,
regardless of what OS you're using. That's a pretty compelling
attraction for agile programming.


There are some downsides to this; JAVA is generally slower than a language
like C++ because of the extra time needed by the Virtual Machine. With how
fast computers are today, most people do not care about the performance
penalty in their applications (the penalty is usually pretty small now).

I would say "the penalty is usually pretty small now" is very context
sensitive. Not to pick on you personally, but the general embracing
of the "memory is cheap" or "performance is good enough" is popular in
the Java community, and it's wrong to me. Maybe that's because I use
everything from MASM to IBM 370 BASM to C, C++, Java, VB and Perl, not
sure...

But I would never, or at least rarely, use Java for desktop utilities
I create for myself because the startup time is dreadfully slow, and
the impact on other applications is large. If you're running a system
with a GIG or less of RAM, firing up a memory-hungry JVM isn't
something you do hastily. Run something like Process Explorer (http://
www.microsoft.com/technet/sysinternals/ProcessesAndThreads/
ProcessExplorer.mspx) and look at the responsiveness of the UI. You
can tune Java apps all day and you simply can't get that without ultra
high-speed hardware.

I can start Java apps on my 3GHz Pentium and the drain on the system
is highly noticable. I'll have periods where the system is completely
unresponsive to mouse clicks, or the mouse pointer icon lumbers across
the screen. Shut down those apps and the system returns to the
standard Windows response (which is still barely tolerable, but at
least it's better). I could probably do some tuning to counteract
that, but that defeats the purpose of writing quick-n-dirty utilities
to rapidly perform some function.

I think of Java programs like driving a Winnebago. For comfort and
ease of travel it's hard to beat, especially on long trips where you
want lots of room and comfort and not have to deal with meticulous
details like where to set your full coffee cup or worrying about where
to toss your trash -- most of these are taken care of you by the
environment.

For quick trips around town, negotiating road space during rush hour,
or for parallel parking on crowded city streets it's overkill and
difficult to maneuver.

I always have felt the Java language is superlative, but the Java
runtime model is gluttonous, and that two things would greatly help
Java, IMO:

1) Optional override on storing data as unicode: why pay for something
if you don't need it? Unicode is great if you need multinational
support, but in 27 years of programming I've maybe needed that in two
applications. Converting data back and forth when I don't need it is
like paying for a cable TV subscription for your home when you are a
traveling salesman who's on the road 7 days a week. Wasing
computational energy degrades responsiveness of programs running in
the JVM as well as programs running in the system outside of the
JVM.

2) Optional override on garbage collection: If I don't want garbage
collection, or I want to decide when it is going to run, then I want
to control it. Garbage collection makes things "safe," but not all of
us need that safety. I've written OS's from the ground up, so I'm
totally comfortable in my memory mgmt skills. When I'm trying to
streamline processing, spurious threads I didn't start are problematic
and get in the way. I like having control when I program, and there
are times I don't want GC and it'd be nice to shut if off.

These things degrade the Java footprint, IMO. Many purist Java-only
programmers will say things like "memory is cheap" or "with the
current speed of CPUs" etc. But that's a really bad philosophy and a
cop out. It's insensitive to optimization, basically pretending
response time and memory footprints are of little importance.
Memory's cheap if you already bought it and it's installed right now
-- it's neither cheap nor convenient if, for example, you just ran out
in the middle of some long running process, or when the system's so
lethargic that mouse clicks seem to be running across an RS-232 port
at 4800 BAUD.

Software engineers don't have to get bogged down with making every
nanosecond count, but we shouldn't ignore the fact that systems are
never fast enough, never responsive enough, never have enough memory,
never enough disk space, and that the faster and bigger the HW folks
make'm, no matter how fast and big, the faster we bog'm down with OS's
that require multiple DVDs to load and multiple GIGs of memory to
work.

Java is a beautiful language with a rich, expressive syntax and a vast
array of easy-to-use classes in the community. Those are a couple of
big reasons its popularity has grown. The more SW engineers can do to
shrink the performance gap between Java and natively-compiled
languages like C/C++ and the more we take memory footprints and CPU
cycles seriously, the better off Java will be.

Performance is the biggest drawback to using Java, maybe its only big
drawback, and that's why I'm such a huge opponent against blanket
statements that ignore this side of the Java tradeoff.

Again, this is more of a spew in all directions in an attempt to get
all J-programmers thining, than a direct response to your note.
Didn't want it to come across as a flame, cuz it's not.

.



Relevant Pages

  • Re: Why do some people hate java?
    ... programming language like Java to exist, or if Java must exists, there's ... The majority of programmers at the time were using C++, ... and other resources that are just as important to ...
    (comp.lang.java.programmer)
  • Re: Whats the best language to learn...
    ... on processors designed to run Lisp and Lisp OSes. ... byte-addressed memory, has native support for variable-sized value types, ... popular OO language, rather a language about like that of Delphi would have ... lisp, java, ruby, etc. ...
    (comp.programming)
  • Re: How did C++ beat the competition?
    ... Efficiency is supposed to be built into the JVM, ... With C++ that meant that programmers had to learn a lot more or only use ... about Java as C++ programmers know about their language. ...
    (comp.lang.cpp)
  • Re: CollabRx seeks brilliant engineers for an excellent e-science adventure
    ... belief that lisp programmers are smarter/better. ... Java or PHP programmers. ... a type of language that attracts a personality that meets my perceptions ...
    (comp.lang.lisp)
  • Re: Popularity of programming languages
    ... and the penalty for it is a language that is generally much ... A much bigger difference than GC between Java and C++ is the object ... Lisp-like uniform object referencing, but manual memory management ... and nobody can do JIT compilation right (probably because the ...
    (comp.lang.lisp)