Re: VS.NET against JAVA

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Alun Harford <devnull@xxxxxxxxxxxxxxxxx> wrote:
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 - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.



Relevant Pages

  • Re: Cpp Considered Harmful
    ... >> programming language, the compiler, the IDE, the libraries, etc. ... source file, the implementation shall locate the declaration, (and ... to name one of the defining source files on the command line that initiates ... The counterpart to this in Java is accomplished using the following: ...
    (comp.lang.cpp)
  • Re: VM complexity curves...
    ... support to an app without having to drag around zlib or libjpeg, ... (overly monolithic, awkward to interface with, ...). ... I ended up not using the GC for most of my compiler stuff, ... using a standard Java compiler offers no real ...
    (comp.lang.misc)
  • Re: wie Array für statische Methoden
    ... > auf gar keinen Fall Java empfehlen;) ... Ich hab mal mit virtuellen Methoden auf einem Microkontroller experimentiert und bin zu dem Schluss gekommen: ... > Es ist ja gerade der Vorteil bei Java einen Compiler ... > Dinge zu optimieren, ...
    (de.comp.lang.java)
  • Re: What is the fastest method of parsing scheme?
    ... These issues can be eliminated by the use of custom memory allocators ... Any other ideas why Scheme would be faster than C++ and Java for heap ... For example, in my compiler, the procedure ) ...
    (comp.lang.scheme)
  • Re: A 21st Century Apple II?
    ... Java 6 -Xms64m 24.00s ... Which is actually 9.6% better than the C++ Intel compiler. ... I'm sure in some cases the GNU compiler produces better results. ...
    (comp.sys.apple2)