Re: Help me!! Why java is so popular
- From: "raddog58c" <raddog@xxxxxxxxx>
- Date: 6 Feb 2007 16:03:35 -0800
On Feb 6, 4:41 pm, Mark Thornton <mark.p.thorn...@xxxxxxxxxxxxxxxxxx>
wrote:
raddog58c wrote:
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.
If we are talking about arbitrary applications then that only works for
applications that actually have a window.
Sure enuff, but point being the tradeoff between getting to the OS
layer or stopping at the language layer. Java stops you at the
implementation, unless you go JNI -- that prevents some things, but
that prevention faciliates more portability. It's a tradeoff.
You can't do that in Java, however, unless you go JNI.
On the other hand if we are talking about testing for an instance of
your own application (written in Java) then that is possible without
resorting to JNI.
Absolutely. The point in this case was again the tradeoffs.
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...
Sometimes the penalty can be zero or even negative, particularly for
applications which run long enough to eliminate the startup effects of
JIT compiling.
How can it negative? I'm not saying you're wrong, but how can any
byte-coded language outperform a binary language if they are doing the
same thing? It can't, because you have to convert the byte code to
the native binary stream before you can execute it. So I'm thinking
you mean certain algorithms are more efficiently handled by the JVM?
Please elucidate -- I heard someone say Java memory management now
exceeds C and I thought it was an interesting notion and probably
related to some ingenius optimizations in memory mgt algorithms,
though I honestly don't know.
Rubbish. You can do quite a lot of useful work with the JVM 'using' only
8MB or less which is trivial in the context of 1GB memory. I've been
running a service, written in Java, which has no noticeable effect on
the responsiveness of my normal applications. It sits there all day
doing its stuff and I can easily forget that it is still running. My
machine is a 4 year old 3.06GHz Pentium with 1GB of RAM.
No doubt, and Java's fine messaging implementation and rich set of
protocol support, eg, makes it a good vehicle for such things. A
service I'm fine with -- a utility I need to fire up over and over,
not so fine with that. I wouldn't write that in Java.
At one time there was a Java compiler that let you go from Java
to .EXE. I used it quite a bit, although the .EXEs it generated were
pretty fat for the functionalit they implemented. Then again Java's
not about creating .EXEs, so that didn't surprise me.
Languages have strengths and weaknesses. When it comes to my tools I
want as close to subsecond response time as possible, so I'm looking
for .EXE based apps. If I'm parsing huge chunks of random text, I'm
all for Perl. If it's XML or a large messaging paradigm, Java's
great.
Look who is making blanket statements. I care a lot about performance,
but I don't have a problem in this respect with Java. Java isn't
perfect. For some applications it can be slower than say C++, but in
other cases it can be just as fast (or even faster).
What would be an example where it's faster? I write a lot of Java
these days, as well as a lot of C++ and even some C and ASM. I know a
decent bit about Java best practices, but I'm not in Java 7x24 -- so
if there's a way to make my Java scream, I'd like to know. At best
I'm looking at avoiding fat objects with features I don't need, such
as synchronized collections like Vectors where a single thread is
using the object.
How does one get Java to run faster than a compiled language? It
would seem there has to be a catch or specific circumstances for that
to occur, because it's hard to fathom how that could be the case.
Thanks for the comments, by the way.
.
- Follow-Ups:
- Re: Help me!! Why java is so popular
- From: Mark Thornton
- Re: Help me!! Why java is so popular
- From: Chris Uppal
- Re: Help me!! Why java is so popular
- References:
- Help me!! Why java is so popular
- From: amalikarunanayake
- Re: Help me!! Why java is so popular
- From: Jack Kielsmeier
- Re: Help me!! Why java is so popular
- From: raddog58c
- Re: Help me!! Why java is so popular
- From: Mark Thornton
- Help me!! Why java is so popular
- Prev by Date: Re: Making Java Act Like A Form
- Next by Date: Re: programming styles
- Previous by thread: Re: Help me!! Why java is so popular
- Next by thread: Re: Help me!! Why java is so popular
- Index(es):
Relevant Pages
|