469,636 Members | 1,544 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,636 developers. It's quick & easy.

Writing apps for Windows platform in Java? Why?


I like Java just as much as I like C#, but the truth is that unless
you absolutely need platform portability, DotNet is the way to go.

This is becoming even more true with the release of Windows Vista
later this year. Users will quickly get used to the flashy Mac-Like
UI of Vista and expect all their apps to support Vista specific
features. Java will try to play catchup but but the UI will stll be
primitive compared to .Net, and it will not perform as well on Windows
platform.

Just one more nail in the coffin to Java and the reason I've bailed on
it and I will stick with .Net for now.
Jun 2 '06 #1
12 3943
well,
Well You can give up Java, Java is not for the Faint of mind, the cowards,
the weak. Java is for intellectuals who believe in Open Source Program
Development, we are not folks to be held captive by a company in Redmond,
feeding their pockets, we are Linux,unix Messiahs. Even though the vista
Might look flashy I bet it gonna Gozzle a whole lot of memory and processing
power, and ask your self can you leave any microsoft server up for like a
year without rebooting definately not . with Unix/Java You can.Java Is not
playing catch up to nobody instead C# is the one trying to catch up on Java

"Von Clubusev" <vc@gaveup javaforgood.com> wrote in message
news:2h********************************@4ax.com...

I like Java just as much as I like C#, but the truth is that unless
you absolutely need platform portability, DotNet is the way to go.

This is becoming even more true with the release of Windows Vista
later this year. Users will quickly get used to the flashy Mac-Like
UI of Vista and expect all their apps to support Vista specific
features. Java will try to play catchup but but the UI will stll be
primitive compared to .Net, and it will not perform as well on Windows
platform.

Just one more nail in the coffin to Java and the reason I've bailed on
it and I will stick with .Net for now.

Jun 12 '06 #2
On Mon, 12 Jun 2006 18:27:03 GMT, "Juju" <Ne****@dodo.com> wrote:
well,
Well You can give up Java, Java is not for the Faint of mind, the cowards,
the weak. Java is for intellectuals who believe in Open Source Program
Development, we are not folks to be held captive by a company in Redmond,
feeding their pockets, we are Linux,unix Messiahs. Even though the vista
Might look flashy I bet it gonna Gozzle a whole lot of memory and processing
power, and ask your self can you leave any microsoft server up for like a
year without rebooting definately not . with Unix/Java You can.Java Is not
playing catch up to nobody instead C# is the one trying to catch up on Java


There are a few dozen COBOL programmers out there saying the same
thing about their language too. Old farts die hard.

Jun 13 '06 #3
Pugh wrote:
On Mon, 12 Jun 2006 18:27:03 GMT, "Juju" <Ne****@dodo.com> wrote:
well,
Well You can give up Java, Java is not for the Faint of mind, the cowards,
the weak. Java is for intellectuals who believe in Open Source Program
Development, we are not folks to be held captive by a company in Redmond,
feeding their pockets, we are Linux,unix Messiahs. Even though the vista
Might look flashy I bet it gonna Gozzle a whole lot of memory and processing
power, and ask your self can you leave any microsoft server up for like a
year without rebooting definately not . with Unix/Java You can.Java Is not
playing catch up to nobody instead C# is the one trying to catch up on Java


There are a few dozen COBOL programmers out there saying the same
thing about their language too. Old farts die hard.


Uhm, Pugh, I'm not sure exactly what you mean by your comment.
Do you mean that Cobol coders claim that COBOL is totally leet?

And Juju, are you being ironic, sarcastic or both (in this context, yes
there would be a difference between the two, at least in my eyes)?
Just looking at the sys reqs for Vista tells you that it will eat
memory, cpu and gpu.
Hell, if your computer isn't ancient, it will use DirectX 9 for
rendering the Windows in 3D,
quite similar to Project Looking Glass (which I believe uses OpenGL).
And yes, you can leave a Windows computer running for a year straight,
but you had better not connect it to da intahrweb if you do, cause
there'll be a lot of vulnerabilities you should have fixed through
Windows Update along the way.
Only retards need to reinstall Windows twice a year, and only idiots
need to ever reinstall it at all.
Heck only time I reinstalled Windows XP was after my PSU fried my
computer, and all my hard drives (actually anything connected to large
molex connectors got fried and the motherboard).
I've never had to reinstall any Linux distros either, but there are new
distros coming all the time,
so usually you have to reboot more than once a year because of nice new
kernels, or simply that you suddenly have an unsupported legacy distro.
But I've had Linux comps up for several months straight.

Anyway, there are reasons to code in Java,
but if you're going to only support Windows anyway,
a lot of those reasons tend to disappear.
Especially since C# is very similar to Java in just about every way
imaginable,
so coding something in C# instead, should be relatively simple for those
who are familiar with Java.
So coding in Java should be done either because:

1. You love Java so much and find it to have real ultimate power and
it's totally sweet. Java for teh win.

or

2. You want to run your apps on Linux/OS X/Amiga OS(I'm not sure if
there's Java support even on PPC based Amiga OS machines)/Solaris ++ ++

Sure C# is supposed to be cross-platform, but I doubt any DirectX stuff
you decide to put into it is very cross-platform unless someone makes a
managed DirectX to OpenGL wrapper for other platforms.
Jun 13 '06 #4
Pugh wrote:
On Mon, 12 Jun 2006 18:27:03 GMT, "Juju" <Ne****@dodo.com> wrote:

well,
Well You can give up Java, Java is not for the Faint of mind, the cowards,
the weak. Java is for intellectuals who believe in Open Source Program
Development, we are not folks to be held captive by a company in Redmond,
feeding their pockets, we are Linux,unix Messiahs. Even though the vista
Might look flashy I bet it gonna Gozzle a whole lot of memory and processing
power, and ask your self can you leave any microsoft server up for like a
year without rebooting definately not . with Unix/Java You can.Java Is not
playing catch up to nobody instead C# is the one trying to catch up on Java

There are a few dozen COBOL programmers out there saying the same
thing about their language too. Old farts die hard.

I would suggest more than a few dozen. And they primarily exist in the
mainframe world, which is now considerably reduced from the hardware
vendors of some 40 years back. You can't really give OO a shot if you
haven't got the appropriate COBOL compiler can you ? There is an Hitachi
compiler lurking around, not sure if it is mainframe but anyway it's
restricted to use in Japan only. Currently there is an OO compiler being
developed by Fujtsu-Siemens in Germany.

As for dear old Big Blue, couple of years old now but you can use OO
with their Enterprise compiler. While it follows the J4 (COBOL 2002
Standard) to produce Class/Factory/Instance syntax all classes inherit
from Base. Guess what; in IBM's case it reads :-

MyClass inherits from JavaBase !

Java creates/destroys objects plus uses Java support classes for
lists(collections) and GUI-ing.

Now if as a result of some mental aberration you can persuade your
installation to upgrade to IBM Enterprise ($??????) then you can get
into OO.

PC-wise down basically to (a) Liant (RM/COBOL), Acu COBOL, HP/Compaq -
these three use ancillary tools for GUI-ing - not true OO. (b) Fujitsu
and Micro Focus both have fool-bloodied OO (as well as Procedural)
giving support classes for both collections/lists and GUI controls, plus
the Web. In addition inter-language operability to invoke or be invoked
from Java or C++ etc. Both since have now got into the dotNet game.

Can't tell you how well Fujitsu functions because they don't have any
sort of newsgroup to guage what developers are doing. On the other hand
Micro Focus has their own Forum. Most questions are directed at one of
their GUI tools Dialog System - which comes with a set of template
applications per GUI control. But this allows them to avoid truly
dabbling in OO. Now they get stuck - great reticence to 'expand' on what
the templates allow. For example you want to change which icons are
displayed in a Treeeview. Can't do it by accessing Public methods.
Achievable by sub-classing - but they shudder at super and sub-classing.

Meanwhile of course the above two compilers provide a link to dotNet and
VB, C# whatever. Given that Visual Studio look-and-feel and a Treeview
of methods per class you are coding - suddenly the light begins to
shine. Next question, why stick with COBOL - go dotNet!

Hindsight - but way back around early eighties - if COBOL had taken note
of what the Xerox PARC team were doing - the world could be known as
COBOL/Smalltalk. Perhaps the foundation stone for the Bellingham
University may have have been laid. Sadly, James Gosling might still be
up here in Calgary twiddling this thumbs. :-)

Jimmy
Jun 14 '06 #5
I don't know about the future but I've just done a test now and Java ran
a lot faster then .NET. If you wanna test yourself just do the
following: Create a simple GUI with a text area and a button. On a
button click event put the following code:

JAVA

String st = "a";
for (int i = 0; i < 30000; i++ ) {
textArea.setText(st);
st += "a";
}
System.exit(0);

C#
string st = "a";
for (int i = 0; i < 30000; i++ ) {
textArea.Text = st;
st +="a";
}
this.Close();

The results I got executing this code, on the same machine, were:

Java, executed in 1 minut and ~40 seconds, used near to 30 MB of RAM.

C# .NET, didn't finished executing in more than 5 minuts, so I ended it
by force. Used near to 10 MB of RAM during this time.

I don't know what you might think, but for mem Java performed a lot
better even though it used more RAM.

The Versions used ware: JVM 1.5.0_07
.NET 2.0 (Visual C# Express 2005)
Jun 25 '06 #6
On Sat, 24 Jun 2006 22:55:05 -0500, Scirious <sc******@scirious.com>
wrote:
I don't know about the future but I've just done a test now and Java ran
a lot faster then .NET. If you wanna test yourself just do the
following: Create a simple GUI with a text area and a button. On a
button click event put the following code:

JAVA

String st = "a";
for (int i = 0; i < 30000; i++ ) {
textArea.setText(st);
st += "a";
}
System.exit(0);

C#
string st = "a";
for (int i = 0; i < 30000; i++ ) {
textArea.Text = st;
st +="a";
}
this.Close();


I cannot speak for the optimal way in Java, but in C# this is an
extremely poor way to implement string concatenation. All but the
most inexperienced C# developer would use an instance of the
StringBuilder class to do string concatenation in a loop. The String
type has some other advantages in .Net but concatenation is not one of
them. I think you'll find the results quite a bit speedier, it would
be interesting to know how the results compare to Java. Also be sure
that when you test C# code you are compiling to Release rather than
Debug and that you have appropriate optimizations turned on.

As always, the effectiveness of the software often has more to do with
the programmers proficiency level in the language he is using rather
than some dependency on the language itself. About 7-8 years ago
there was some sort of VB versus C++ competition, and essentially the
outcome was that a well-seasoned VB programmer could write an
application that ran circles around an equivilent app produced by an
average C++ developer.

Jun 25 '06 #7
Both are poor programming in their respective languages. Java also has
the StringBuilder class that is a lot better to use concatenation. The
code would be the folloing for the optimal usage:

Java:

StringBuilder sb = new StringBuilder("a");
for (int i = 0; i < 30000; i++) {
sb.append("a");
}
textArea.setText(sb.toString());

C#

StringBuilder sb = new StringBuilder("a");
for (int i = 0; i < 30000; i++) {
sb.Append("a");
}

textArea.Text = sb.ToString();

With the code above both run so fast that I can't measure with the
resources Ihave. However, notice that I put the toString()/ToString()
outside the loop.If I set the text of the textarea inside the loop with
StringBuilder, none of the codes end before I decide to stop it by
force.
Jun 25 '06 #8
On Sun, 25 Jun 2006 16:33:15 -0500, Scirious <sc******@scirious.com>
wrote:
Both are poor programming in their respective languages. Java also has
the StringBuilder class that is a lot better to use concatenation. The
code would be the folloing for the optimal usage:

Java:

StringBuilder sb = new StringBuilder("a");
for (int i = 0; i < 30000; i++) {
sb.append("a");
}
textArea.setText(sb.toString());

C#

StringBuilder sb = new StringBuilder("a");
for (int i = 0; i < 30000; i++) {
sb.Append("a");
}

textArea.Text = sb.ToString();

With the code above both run so fast that I can't measure with the
resources Ihave.
Doesn't seem like you're trying to be very resourceful, its quite easy
to time code down to the milliseconds or just increase the number of
iterations to the point where you would be measuring it in terms of
seconds.
However, notice that I put the toString()/ToString()
outside the loop.If I set the text of the textarea inside the loop with
StringBuilder, none of the codes end before I decide to stop it by
force.


And at no point during this experiment did it occur to you that
there's a possibility setting the Text property of the textArea is
your bottleneck?

That was one of my basic problems with this rather haphazard
benchmarking experiment. The reader was left to guess what textArea
might be. Assuming it is a TextBox control on a WinForm app, you
would be comparing apples to oranges by comparing performance against
whatever Java control resembles it the most. A TextBox control in
..Net is designed to do certain things well, and sticking large strings
in it one character at a time in a loop would be a very unrealistic
functionality scenario (anyone in their right might would build the
string up first, then assign it to the textbox).

I would be interested in knowing what kind of performance differences
you notice on your machine wth the controls removed from the equation.
Just make the number of iterations longer, and it C# you can save the
time before the loop starts and put the result in a TimeSpan value to
see how much time has elapsed.
Jun 25 '06 #9
Well, yet I don't get the milliseconds but with the following code results
were different. the code was:

Java:

Date now = new Date();
DateFormat dt = DateFormat.getTimeInstance(DateFormat.DEFAULT, new Locale
("pt","BR"));
String s = dt.format(now);
jTextArea1.setText(s +"\t");
StringBuilder st = new StringBuilder("a");
for (long i = 0; i < 100000000; i++) {
st.append("a");
}
Date now2 = new Date();
DateFormat dt2 = DateFormat.getTimeInstance(DateFormat.DEFAULT, new Locale
("pt","BR"));
String s2 = jTextArea1.getText() + dt2.format(now2);
jTextArea1.setText(s2);

C#

DateTime dt = DateTime.Now;
textBox1.Text = dt.ToString()+"\t";
StringBuilder st = new StringBuilder("a");
for (int i = 0; i < 100000000; i++) {
st.Append("a");
}
DateTime dt1 = DateTime.Now;
textBox1.Text += dt1.ToString();

I'm not sure if those are the best way to do it in their respective
langages, but the results were:

..NET uses up to 335 MB of RAM and takes up to 5 seconds to finish.

Java uses up to 510 MB of RAM and takes up to 7 seconds to finish.
Actually, I had t start the JVM using the -Xmx550m switch because otherwise
it would cause the OutOfMemoryError exception and would not execute
properly.

Scirious.
Jun 26 '06 #10
On Sun, 25 Jun 2006 23:28:04 -0500, Scirious <sc******@scirious.com>
wrote:
I'm not sure if those are the best way to do it in their respective
langages, but the results were:

.NET uses up to 335 MB of RAM and takes up to 5 seconds to finish.

Java uses up to 510 MB of RAM and takes up to 7 seconds to finish.
Actually, I had t start the JVM using the -Xmx550m switch because otherwise
it would cause the OutOfMemoryError exception and would not execute
properly.


Thanks for re-working it. These results mirror other benchmarks I've
seen of Java vs. .Net. It's to be expected when you think about it,
Java is designed for multi-platform development where .Net is going to
have a natural speed advantage on Windows. Even when Microsoft was
creating their own JVM, it was substantially faster than Sun's.
Jun 26 '06 #11
G.T. wrote:
On Sun, 25 Jun 2006 23:28:04 -0500, Scirious <sc******@scirious.com>
wrote:
I'm not sure if those are the best way to do it in their respective
langages, but the results were:

Instead of Date objects I would just use the System.nanoTime() function
(unlike currentTimeMillis it gives you accurate timing in nano seconds)...
There's probably something similar available in C#...
Thanks for re-working it. These results mirror other benchmarks I've
seen of Java vs. .Net. It's to be expected when you think about it,
Java is designed for multi-platform development where .Net is going to
have a natural speed advantage on Windows. Even when Microsoft was
creating their own JVM, it was substantially faster than Sun's.


Actually .NET is cross-platform, or at least supposed to be.
There are VMs available for Linux for instance, I think only things like
managed directx is unsupported on other platforms.
It wasn't just the MS JVM that was faster, but they if I remember
correctly, kind of screwed with the byte code too, and had some
optimizing there in their J++ compiler, which wasn't 100% supported on
other JVMs.
MS weren't that great at keeping up with specs, and added a lot of their
own stuff in there, which was why they got sued, but yeah, it was faster,
but I believe that IBM's JVM is faster than Sun's, and there are other
JVMs out there that are supposed to be faster than Sun's...
It's sort of like comparing GCC with VC, GCC has great support for
platforms(works on almost any platform imagineable, very easy to add new
support as well), it also has support for features in newer C/C++ specs
than VC, but VC is insanely fast and has one of the best optimizers
around...
Jun 27 '06 #12
"Sigmund Hansen" <si******@student.hf.uio.no> wrote in message
news:k0%ng.2768$YI3.160@amstwist00...

Actually .NET is cross-platform, or at least supposed to be.
I think it's rather ".NET is kind of cross-platform, despite the fact
that it's not supposed to be." I don't think, when Microsoft designed .NET,
that crossplatform capabilities was one of their goals. It's just that by
using a VM-based language makes it easier for 3rd parties (like the Mono
development team) to write VMs on other platforms.

There's various copyright issues with the .NET API library for example
which prevents some parts of it from being ported over to Mono, for example
(I think most notably the GUI parts).
There are VMs available for Linux for instance, I think only things like
managed directx is unsupported on other platforms.
AFAIK, nothing is supported on other platforms. That is, if you run a
Mono on Linux, and you have problems and you call Microsoft, they're not
gonna help you.
It wasn't just the MS JVM that was faster, but they if I remember
correctly, kind of screwed with the byte code too, and had some optimizing
there in their J++ compiler, which wasn't 100% supported on other JVMs.
MS weren't that great at keeping up with specs, and added a lot of their
own stuff in there, which was why they got sued,
Right: Sun owns the trademark for the term "Java", and you can't call
your product a "Java Virtual Machine" without Sun's permission. Sun provides
a license which allows you to call your product a "Java Virtual Machine" as
long as it's actually compatible with Java (they actually have a testing
suite to test your JVM against). Microsoft's JVM wasn't compatible with
Java, and thus they were illegally using the trademarked term.
but yeah, it was faster,
but I believe that IBM's JVM is faster than Sun's, and there are other
JVMs out there that are supposed to be faster than Sun's...
It's sort of like comparing GCC with VC, GCC has great support for
platforms(works on almost any platform imagineable, very easy to add new
support as well), it also has support for features in newer C/C++ specs
than VC, but VC is insanely fast and has one of the best optimizers
around...


Interesting, I never knew this about GCC/VC.

- Oliver

Jun 29 '06 #13

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

48 posts views Thread by Joseph | last post: by
31 posts views Thread by Carlos Ribeiro | last post: by
16 posts views Thread by The Ruling Class | last post: by
385 posts views Thread by Xah Lee | last post: by
2 posts views Thread by Kees de Winter | last post: by
19 posts views Thread by Dotan Cohen | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.