473,385 Members | 1,384 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

VS.NET against JAVA

I'm studying differences between those two architecture in order to
choose a setup to develop a completely new application. I'm a
programmer with some experience on C++ and PHP and i have basic
academic knowledge of VS.NET and Java and a few other. My application
is a data driven business application heavily based on GUI and will be
deployed mainly on Windows systems, but i eventually may like the
possibility to deploy it on Mac (most probably) and or Linux (least
probably).

Exclude AWT libraries, because their limited choice and heavyweight,
choose a Java IDE as you like (i.e. Eclipse, JDeveloper,
NetBeans....), include Swing and eventually some other Swing based
libraries.

Questions:

VS.NET (C#) against VS.NET (VB.NET) about easy of development of GUI
and Data access

VS.NET (C#) against JAVA about easy of development of GUI and Data
access

VS.NET (C#) against JAVA about speed of execution of the application
on Windows

VS.NET (C#) against JAVA about availability and compatibility on Mac
(or eventually Linux)

In this specific case, this last question is the least important, but
i would like to know if Mono is going somewhere and is somewhere near
to be functional.
On question 2 and 3 i would prefere to only hear opinion of those of
you who actually know and use or used Java Swing.

Thank you.

Jun 4 '07 #1
8 1888
Questions:
>
VS.NET (C#) against VS.NET (VB.NET) about easy of development of GUI
and Data access
No diffierence. No .NET language is really any better/worse than the other.
It's a matter of preference.
VS.NET (C#) against JAVA about easy of development of GUI and Data
access
My opinion is that VS .NET will provide an easier development path in terms
of GUI and RAD.
VS.NET (C#) against JAVA about speed of execution of the application
on Windows
Just a side note here: All .NET langauages compile to a single Intermediate
Lanaguage (IL), so you don't have to specify C# when you talk about .NET
development when asking gereal questions. In other words, it doesn't matter
what .NET language you use, they will all perform more or less equally when
given the same task to do and written with the same logic.

Having said that, there are numerous benchmark tests that have been done to
compare the performance of applications written in Java vs. .NET
(http://www.google.com/search?q=perfo...e=utf8&oe=utf8)
VS.NET (C#) against JAVA about availability and compatibility on Mac
(or eventually Linux)
You didn't mention if this was going to be a client app or a web app. If
it's a web app, the question is irrelevant. Yes there are projects to port
..NET to other platforms (Mono), but it's anyone's guess as to where that
will be in the future as new versions of the Framework appear.

>
In this specific case, this last question is the least important, but
i would like to know if Mono is going somewhere and is somewhere near
to be functional.
On question 2 and 3 i would prefere to only hear opinion of those of
you who actually know and use or used Java Swing.

Thank you.

Jun 4 '07 #2
VS.NET (C#) against JAVA about availability and compatibility on Mac
(or eventually Linux)

You didn't mention if this was going to be a client app or a web app. If
it's a web app, the question is irrelevant. Yes there are projects to port
.NET to other platforms (Mono), but it's anyone's guess as to where that
will be in the future as new versions of the Framework appear.
There are parts of the system developed with a web architecture
(mainly the website data aggregator to the benefit of general public
and a subset of the basic functionalities to provide some mobility)
and with this regard i'm also considering about using PHP instead of
ASP.NET and i will probably post another message on this topic later.

Most functionalities of the system, anyway, are inside a desktop
client/server application (to allow a better management of the
interfaces) where the server part is mostly a data server.

Jun 4 '07 #3
Gabriele wrote:
VS.NET (C#) against VS.NET (VB.NET) about easy of development of GUI
Development of GUI in VS/C# is trivial, whereas in Java it's very
painful. Personally I found my GUI development to take 1/10th of the
time when I switched from Java to C#.
and Data access
I prefer JDBC (Java) to ADO.NET (C#), by a long way. But neither is
particularly painful.
VS.NET (C#) against JAVA about speed of execution of the application
on Windows
Java and C# both execute pretty quickly - they're both JIT compiled
languages...
Which is faster depends on what you're doing.

For raw processing power, Java is superior (the C# compiler needs
serious work on optimization).
*However*, AWT/Swing are *much* slower than windows forms, by several
orders of magnitude.
VS.NET (C#) against JAVA about availability and compatibility on Mac
(or eventually Linux)
Mono basically isn't a serious option yet. One of the reasons why C# is
much easier to develop in is that if the framework doesn't contain a
required feature, you can just P/Invoke and send windows messages.
Unfortuately, until Mono merges with Wine, this is unlikely to ever be
supported :-(

Alun Harford
Jun 4 '07 #4
Alun Harford <de*****@alunharford.co.ukwrote:

<snip lots of bits>
Gabriele wrote:
VS.NET (C#) against VS.NET (VB.NET) about easy of development of GUI

Development of GUI in VS/C# is trivial, whereas in Java it's very
painful. Personally I found my GUI development to take 1/10th of the
time when I switched from Java to C#.
But do all your forms resize nicely? I've found that (prior to WPF)
it's very easy to create a *bad* UI in .NET, but hard to create a
*good* one. Java's layout managers take a while to get used to, but end
up creating a better app.

Oh, and I believe the Java GUI designers have come on a lot in the last
year or so. I haven't used them myself.

Having done a little bit of WPF now, it looks like that will be a
*much* better way of doing UI in my view - especially as it means I can
avoid the designer and still be nice and quick :)
Java and C# both execute pretty quickly - they're both JIT compiled
languages...
Which is faster depends on what you're doing.

For raw processing power, Java is superior (the C# compiler needs
serious work on optimization).
Most optimisation isn't done by either the C# or Java compilers. It's
done by the JITs. I preferred the earlier sentence: it really *does*
depend on what you're doing. If you're using virtual methods which have
never been overridden and can be inlined, Java will be a lot better. In
other cases, C# will be faster. That goes to raw execution as well as
graphic libraries.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Jun 4 '07 #5
Jon Skeet [C# MVP] wrote:
Alun Harford <de*****@alunharford.co.ukwrote:

<snip lots of bits>
>Gabriele wrote:
>>VS.NET (C#) against VS.NET (VB.NET) about easy of development of GUI
Development of GUI in VS/C# is trivial, whereas in Java it's very
painful. Personally I found my GUI development to take 1/10th of the
time when I switched from Java to C#.

But do all your forms resize nicely? I've found that (prior to WPF)
it's very easy to create a *bad* UI in .NET, but hard to create a
*good* one. Java's layout managers take a while to get used to, but end
up creating a better app.
While it's true that you can use the VS "designer" to produce some
really bad code, I'd say that's true of any programming tool.
(All my forms resize nicely - well at least all the ones that I allow to
be resized resize nicely)
Oh, and I believe the Java GUI designers have come on a lot in the last
year or so. I haven't used them myself.
The problem isn't the design tool. I think the .NET framework is
superior to AWT/Swing.
(That said, I've not done UI stuff in Java for about 18 months - because
I prefer C# :-) )
>Java and C# both execute pretty quickly - they're both JIT compiled
languages...
Which is faster depends on what you're doing.

For raw processing power, Java is superior (the C# compiler needs
serious work on optimization).

Most optimisation isn't done by either the C# or Java compilers. It's
done by the JITs.
The JIT compiler is a compiler :-). And ideally it should be able to do
basic optimization.
I preferred the earlier sentence: it really *does*
depend on what you're doing. If you're using virtual methods which have
never been overridden and can be inlined, Java will be a lot better. In
other cases, C# will be faster. That goes to raw execution as well as
graphic libraries.
Swing/AWT is much slower than .NET/Windows forms because it does much
more work... if you were to have 'identical' programs as Java bytecode
and MSIL, I'd be impressed if a program can be constructed to make the
MSIL one go faster.

As an example, I recently found that a particular method I'd written was
running slowly, and had to modify it (I'd rather not have to do the
optimizing compiler's job, particularly in simple cases).
It was a more complex than this, but not much:

//input is a 256x256 bitmap
public Bitmap CopyBitmap(Bitmap input)
{
Bitmap output = new Bitmap(256,256);
BitmapData inputData= input.LockBits(new Rectangle(0, 0, input.Width,
input.Height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
BitmapData outputData = output.LockBits(new Rectangle(0, 0,
output.Width, output.Height), ImageLockMode.WriteOnly,
PixelFormat.Format32bppArgb);
unsafe
{
byte* inputPtr = inputData.Scan0;
byte* outputPtr = inputData.Scan0;
for(int i=0;i<256*256;i++)
{
for(int j=0;j<4;j++)
{
*outputPtr = *inputPtr;
}
}
}
input.UnlockBits(inputData);
ouput.UnlockBits(outputData);
return output;
}

Any decent optimizing compiler will take that code and copy the data
words at a time instead of bytes at a time. Even the silly little
compilers I wrote as an undergrad could cope with that task!
But not the .NET CLR :-(

Still, I love it really. I just wish somebody at Microsoft would give it
the care and attention (and expert in optimizing compilers) that it needs.

Alun Harford
Jun 4 '07 #6
Alun Harford <de*****@alunharford.co.ukwrote:
But do all your forms resize nicely? I've found that (prior to WPF)
it's very easy to create a *bad* UI in .NET, but hard to create a
*good* one. Java's layout managers take a while to get used to, but end
up creating a better app.

While it's true that you can use the VS "designer" to produce some
really bad code, I'd say that's true of any programming tool.
(All my forms resize nicely - well at least all the ones that I allow to
be resized resize nicely)
With the extra space being taken up by the correct components and not
others? How about all the labels etc resizing automatically for
different languages etc? Doing all this stuff properly for non-trivial
apps is relatively tricky in WinForms due to the lack of layout
managers.

It's far from a coincidence that WPF's layout is done in a way which is
*very* similar to Java's.
Oh, and I believe the Java GUI designers have come on a lot in the last
year or so. I haven't used them myself.

The problem isn't the design tool. I think the .NET framework is
superior to AWT/Swing.
(That said, I've not done UI stuff in Java for about 18 months - because
I prefer C# :-) )
IMO the problem is both the designer *and* WinForms, both of which
encourage absolute positioning instead of a "lay yourselves out in this
way".

Swing and AWT are a pain in different ways, but for layout capabilities
Java wins hands down IMO.
For raw processing power, Java is superior (the C# compiler needs
serious work on optimization).
Most optimisation isn't done by either the C# or Java compilers. It's
done by the JITs.

The JIT compiler is a compiler :-)
True - but it's not a C# compiler.
And ideally it should be able to do basic optimization.
And indeed it does. With .NET there's only one pass of JIT compilation,
as opposed to HotSpot which is able to
I preferred the earlier sentence: it really *does*
depend on what you're doing. If you're using virtual methods which have
never been overridden and can be inlined, Java will be a lot better. In
other cases, C# will be faster. That goes to raw execution as well as
graphic libraries.

Swing/AWT is much slower than .NET/Windows forms because it does much
more work... if you were to have 'identical' programs as Java bytecode
and MSIL, I'd be impressed if a program can be constructed to make the
MSIL one go faster.
I'll have a go some time - I'm absolutely sure it's possible, as I've
seen plenty of "raw" code which works faster in C# than Java, and vice
versa.
As an example, I recently found that a particular method I'd written was
running slowly, and had to modify it (I'd rather not have to do the
optimizing compiler's job, particularly in simple cases).
It was a more complex than this, but not much:
<snip>

Yes, there are certainly things it could do better. The same is no
doubt true for the Java JIT though.
for(int j=0;j<4;j++)
{
*outputPtr = *inputPtr;
}
Is there meant to be some use of j within that loop? ;)
Still, I love it really. I just wish somebody at Microsoft would give it
the care and attention (and expert in optimizing compilers) that it needs.
Well, I think it already does a fair amount of optimisation, but I'm
sure it'll improve over time.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Jun 5 '07 #7
Jon Skeet [C# MVP] wrote:
Alun Harford <de*****@alunharford.co.ukwrote:
>>But do all your forms resize nicely? I've found that (prior to WPF)
it's very easy to create a *bad* UI in .NET, but hard to create a
*good* one. Java's layout managers take a while to get used to, but end
up creating a better app.
While it's true that you can use the VS "designer" to produce some
really bad code, I'd say that's true of any programming tool.
(All my forms resize nicely - well at least all the ones that I allow to
be resized resize nicely)

With the extra space being taken up by the correct components and not
others? How about all the labels etc resizing automatically for
different languages etc? Doing all this stuff properly for non-trivial
apps is relatively tricky in WinForms due to the lack of layout
managers.
For simple forms that cannot be resized, I don't want a layout manager -
no need.
For more complex forms, I can use Anchor and Dock to get the right effect.
For even more complex forms, there is nothing to stop you from using a
layout manager.
> for(int j=0;j<4;j++)
{
*outputPtr = *inputPtr;
}

Is there meant to be some use of j within that loop? ;)
Oops! :-)
You probably guessed that it should read:

*(outputPtr++) = *(inputPtr++);

Alun Harford
Jun 6 '07 #8
Alun Harford <de*****@alunharford.co.ukwrote:
With the extra space being taken up by the correct components and not
others? How about all the labels etc resizing automatically for
different languages etc? Doing all this stuff properly for non-trivial
apps is relatively tricky in WinForms due to the lack of layout
managers.

For simple forms that cannot be resized, I don't want a layout manager -
no need.
Well, you can use a pretty simple or effectively null layout manager.
However, I'd argue that even for simple forms layout managers are
beneficial - that way you can change things like the contents of labels
without needing to laboriously lay out everything in pixel perfect
fashion.
For more complex forms, I can use Anchor and Dock to get the right effect.
That's really painful compared with using layout managers, in my
experience.
For even more complex forms, there is nothing to stop you from using a
layout manager.
But there's very little support provided in the framework for WinForms.
Fortunately WPF has layout managers as a core part of its design,
making life a lot more straightforward.

(As a case in point, I recently started writing an app in both WPF and
WinForms. I haven't yet finished the WinForms version, because just
trying to get all the resizing right took longer in the WinForms
version than the whole app in WPF.)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Jun 6 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: bugbear | last post by:
Subject pretty much says it all. I'd like to parse XML (duh!) using Xerces (because its fast, and reliable, and comprehensive, and supports lots of features). I'd like to conform to standards...
0
by: Stuart Miller | last post by:
When using Java to read in an XML file, I am having problems getting the XML file to be parsed against the specified DTD. Background: I have an existing Java application that allows users to...
9
by: Achim Kühn | last post by:
I´m planning to write a windows application using the .net framework. is there any way to secure the application so the user can´t easily disassemble and manipulate the application?
10
by: Ellen K | last post by:
Anyone have any tips for using Java against SQL Server? Our IT director is thinking of making us a Java shop, but I really would like to stay with SQL Server as our RDBMS. We have Oracle...
4
by: Tolga Tanriverdi | last post by:
i saw something named obfuscator and its decompiling the source code of my program which written in c# and my program includes mysql root password inside of it is there anyway to protect my...
4
by: IamZIM! | last post by:
I was wondering what performance advantages (or ramifications for all I know) might be apparent if you used Managed C++ (MC++ from know on) instead of C#? I know C# is a pure .NET language since it...
2
by: J-T | last post by:
I need to create a webserivce which is able to talk to the following components: 1) Another webservice which is written by java and talks to its own backend database to authenticate the users...
1
by: Cesar | last post by:
Hello, I've developed a .NET C# web service; which has one method named, let's say, upload_your_data. This method has one parameter ( string your_data). The value that this parameter will...
2
by: rupanjana_ms | last post by:
I'm sorry if this is a basic question but I'm a beginner with XML. I have developed XSDs for XMLs that my company is producing. We now want to have a system where the XMLs that are generated by our...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.