|
![](/i/fill.gif) |
On 22/09/2011 06:56 PM, Darren New wrote:
> I will say, I'm only back into Java for a week, and even in spite of
> Java generics and inner classes and all that, I'm already much more
> appreciative of how much crap MS fixed in C#. :-)
Last time I used Java, we did a little dance. It went like this:
"Object-oriented programming allows you to use facilities such as
subclassing to extend the application in ways the original designers
never anticipated."
"By declaring your class 'final', you can prevent anybody subclassing it."
"Multiple inheritance is EVIL! We support only single inheritance."
"We support multiple inheritance using 'interfaces'. They're like
classes, but not as good."
"For receiving input, use the InputStream classes. For output, use the
OutputStream classes."
"For receiving input, use the Reader classes. For output, use the Writer
classes. The InputStream and OutputStream classes are now formally
deprecated. (Even though System.in, System.out and System.err mention
them explicitly.)"
"We will never deprecate the AWT."
"The AWT is now deprecated. Please use Swing in new applications."
"To create a horizontal scrollbar, create a Scrollbar object passing the
SCROLLBAR_AXIS_HORIZONTAL static constant. To create a vertical
scrollbar, create a Scrollbar object passing the SCROLLBAR_AXIS_VERTICAL
static constant. To determine whether a given scrollbar is horizontal or
vertical, call getAxis() and compare against these static constants. Do
not hard-code the numerical values, as more may be added in future."
"The 'int' type is not a class."
"If you want 'int' to be a class, you must wrap it using the 'Int' class."
"The int[] type is a class."
"For structuring complex applications, use the ApplicationFactory class."
"The ApplicationFactory class is now deprecated. Please use
ApplicationCenter for new."
"The ApplicationCenter class is now deprecated. The ApplicationFactory
class has been formally UNdeprecated. Please use ApplicationFactory for
new applications."
Basically, the language is loaded with hypocrisy, and the libraries were
huge, bloated, overly complex, insufficiently documented, and prone to
radical alterations every minor point release. (In fact, I gather that
these days, they don't even call it Java 1.5.x any more. They just call
it 5.x...)
Last time I checked, java.awt.Component has about 80+ methods. Every
single AWT widget inherits these 80+ methods. Any guesses what the hell
the difference between widget.init(), widget.start() and widget.begin()
is? The documentation helpfully fails to say. (E.g., "start() - starts
the widget." Yeah, thanks for that. I gathered.)
It still amuses me how almost every statically-typed programming
language lacks parametric types, /except/ for arrays, which are
hard-wired into the language.
(It still makes me cry that Haskell to this day still doesn't support
parametric unboxed arrays - you know, like what almost every programming
language known to man /does/ provide, out of the box...)
In Java, "int" is not a class. But "int[]" is. In fact, every array is a
class. And you cannot ever subclass it.
> Stuff that's taking me
> 4 or 5 lines, with the types repeated three times each, is a one-liner
> in C#, even without LINQ.
I love the way that with the JDK, compiling a class compiles every class
it depends on, but declaring two mutually-dependent classes is enough to
break the compiler. I wonder if they fixed that yet?
I love how you run your Java applet in IE and it works perfectly, and
when you run it in Netscape it dies with java.lang.NullPointerException.
I love how we have System.err (because System.error would be far too
verbose), and yet we have java.lang.ArrayIndexOutOfBoundsException.
Because, say, java.language.exception.ArrayIndex would be too hard?
I still think that Java is a great /idea/ - you specify a programming
language and a library of classes which is guaranteed to work the same
on *all* platforms. That's a very neat idea.
I also still think that the actual Java /design/ and /implementation/
utterly suck. Nice idea, too bad it went so drastically wrong from
thereon in.
(I suppose you could argue that C# is the same. You know, if it actually
worked on more than one platform...)
Post a reply to this message
|
![](/i/fill.gif) |