Hi Tony,
am what you could call a junior programmer (less
than 3 years expérience un j2ee)
I'll just respond to a few java related point, as i
don't know .NET
- You say primitives are not nullable. If you need a
nullable integer, use java.lang.Integer.
- Operators overloading is something i consider
dangerous, and i thanks sun for not implementing
those
- We are developping here a webapp which need to be
deployed at several 'clients', whose server
range from linux to windows to HP-UX, so
cross-platform is an important constraint :) This
explains the use of java.
- The 'only one language' of JAVA compared to .NET
make it easier for company to manage the
knowledge of developpers, which can compensate the
knowledge spreading across the various libraries
Those too are only my opinions, and as you express
yours, i express mine :)
BTW, i don't think there is a conflict .NET <-> J2EE
Simply use the right tool for the right purpose.
Le Mercredi 25 Janvier 2006 04:27, Tony LaPaso a
écrit :
Hi all,
I should mention that this post is a bit off
topic. If you hate
Microsoft then stop reading now and I'm sorry for
wasting your time. I
don't own stock in Microsoft, I don't know Bill
Gates and nobody paid
me or asked me to say the things I wrote below.
These are just my
opinions based on my experiences with many years
in Java and two months
of learning .NET/C# 2.0.
I've been programming in Java/J2EE for the past 8+
years, most of this
time as a contractor for several companies on many
J2EE projects. I
even have a small (and now hopelessly out of date)
Java web site that
I've maintained for the past 5+ years at
www.absolutejava.com, which
will be removed in early May.
Until about 8 weeks ago, I never even considered
looking at anything
Microsoft offered. Recently though, on a whim, I
browsed over to the
Microsoft site because I'd heard about their new
release of Visual
Studio. I'd been a Windows programmer back in the
mid '90s and was
curious to see how Visual Studio (it was Visual
C++ back then) had
evolved (or not).
I didn't download Visual Studio but instead I
downloaded a couple free
tutorial videos for Microsoft's "Web Developer
Express" product (which
is a free product, BTW). "Web Developer Express"
has a subset of the
features in the full "Visual Studio" product and
is used for building
server-side (or client side, for that matter) web
apps. I couldn't
believe what I saw. "Web Developer Express" blows
away anything we have
in the Java world for developing server-side web
apps. It was kind of a
jaw-dropping experience to see what the tool can
do and what ASP.NET
offers compared to servlets/JSP/Struts/JSTL/JSF.
I don't want to turn this post into a "feature by
feature" comparison
of ASP.NET and equivalent Java technologies. My
impression, though,
from watching these tutorial videos is that we in
the J2EE world are
living like knuckle-dragging Barbarians,
scratching out an existence
clothed in bear skins, using stone knives and
sticks as our tools of
choice. Those using .NET are living in fine brick
homes with hardwood
floors, fireplaces and regular visits from PeaPod.
After looking at ASP.NET I became interested in
looking at the C#
language, proper. My impressions of C# vs. Java
mirrored those of
ASP.NET vs. servlets/JSP/etc. Java has kludgey
support for properties
and events (they're just regular methods with
parameters) while C# has
the constructs (delegates & events) built directly
into the core
language. C# also supports co-routines, something
we have to simulate
in Java as well as "out parameters" (which allow a
method to change the
caller's parameter's value) and operator
overloading. C# also has
"nullable" types. Imagine Java's primitive types
being able to hold
null values. This is highly useful when working
with databases.
Finally, .NET provides an integrated and more
comprehensive approach to
setting security permissions and versioning of
what are called,
"assemblies". Assemblies are very roughly
equivalent to JARs. This
allows you to compile your code against a specific
version of an
assembly and have that version information
maintained in the resulting
executable. It also allows several versions of the
same assemblies
(again, think "JARs") to co-exist peacefully in a
global, system-wide
cache of assemblies. Sun should have given us
something like this five
years ago.
Another advantage I saw with .NET is that it is
more "cross language"
friendly than Java. First of all, .NET, like Java,
executes a "platform
neutral" representation of a program (analogous to
Java bytecode).
Unlike Java, .NET programs can be written in many
languages (C#, C++,
Perl, Python, J#, VB, and many others).
Microsoft's J# is, from what
I've seen, a clone of Java (although I'm sure
there are differences).
The point I want to make is that once compiled,
.NET programs can call
each other seamlessly, regardless of the language
the programs were
originally written in. So for example, a J# class
can extend a C# class
which can extend a VB class. You're not tied to
one language like you
are in Java.
I know that, theoretically, any language could
potentially be compiled
into Java bytecode (I guess Groovy is an example).
Practically,
however, this is not commonly done.
Suffice it say, I am switching after 8+ years in
Java. It was a tough
decision at first because I have so much time and
effort invested in
Java. When I eventually get on a .NET project I
will be starting over
as a junior person making a junior person's
salary. That won't be
pleasant. I have close to $1,000 in Java books
that I've accumulated
over the years that are now for sale on Amazon.
Ultimately though, I
felt I'd be able to spend more time actually
writing code on a single
consistent, and what seems to be superior platform
(.NET) rather than
gluing together a half dozen open source tools
with XML files, which it
seems J2EE requires far too much of.
To me, J2EE has become too fat and burdensome in
the past few years,
especially with the proliferation of so many
competing open source
projects. I think too much choice can be as bad as
not enough choice.
BTW, I realize .NET is not perceived as being as
"cross platform" as
Java (although that's changing as the Mono Project
[ http://www.mono-project.com] gains traction).
Initially, this lack of
"cross platformability" gave me cause for
hesitation. But then I
started thinking of all the J2EE projects I'd been
on in the past 8