Go go java ... play catch-up with C#
blog.jonasbandi.net
blog.jonasbandi.net
And nowadays the JVM gained so many new and interesting languages: Groovy, JRuby, Scala.
All in all, I find the Java platform more interesting comapared to .Net.
* Properties, via Scala's Uniform Access Principle
* A form of null handling, via the Option type (like Haskell's Maybe monad)
* Indexers, via apply/update methods
* Extension methods, via implicits (Scala's implicits are actually much more powerful/dangerous than C#'s extension methods)
* LINQ[1], via for-comprehensions
* Lambda syntax
* Multi-line strings
* Type inference
As for C#'s future features: * Scala already has co/contravariant typing
* Scala will have optional and named parameters soon (maybe 2.8.0?)
In addition, Scala has: * Pattern matching and extractors
* Lazy evaluation and call-by-name parameters
* Mixin composition
* Curried methods
* Higher-kinded types
* Equal footing for immutable data
* An Actor library for concurrency
Scala's also adding virtual classes soon.F# is also great language, I don't want to say anything bad about it as a language, but unfortunately you're trapped into the Microsoft platform and subject to Microsoft's rules. I'd much rather develop in open-source land.
[1] C#'s LINQ is actually more powerful than Scala's for-comprehensions, because Scala lacks C#'s Expression Trees. Hopefully this will be remedied soon.
(Yes I know about Clojure but it's not Sun Clojure is it?)
(Yes, I know about Mono, but it's not Microsoft Mono is it?)
And saying "no one uses it" is brainless. In 1996 did you dismiss Macromedia Flash 1.0 because no one used it?
J2EE is popular on numerous platforms, including Solaris and AIX.
It's a client side library. nix is predominately used in the server space. The market share isn't large enough. Besides, a significant number of nix desktop users hate Microsoft already and would refuse to install it on principle. Maintaining support for an additional platform is expensive. And even if they did officially support it, what's the point? Mono is actually quite capable if you exclude the Windows specific libraries (which Silverlight already does, even on Windows).
Java & Swing == General-purpose and cross-platform
Objective-C & Cocoa == C# & WinForms == General-purpose and platform-specific
At least in terms of their ORIGINAL goals.
Imagine something with the productivity leverage of the old Lisp machines, backed by a corporation the size of Microsoft. (People used to ask how big the development team was behind the Symbolics Lisp machine, and their jaws would drop when they found out it was an order of magnitude or two smaller than they thought.)
From what little I've seen, the technical fundamentals of .NET seem nicer, and the C# language certainly is. But following Microsoft's footsteps isn't the best way to remain flexible.
By this metric, Java and C# are both extremely poor languages. Java is not especially complicated, but it is far more complicated than is necessary for its (extremely small) expressive powers. C# is extremely complicated already (SQL as a first-class language construct? Really?), and is becoming more complicated, while still not reaching the expressive power of e.g. Scheme.
I think there's a lot to be said for picking which features to leave out.
Maybe I'm alone with this viewpoint though.
Did he leave out unsigned types because he thought we weren't smart enough to cope with them? No, I'd say he left them out because it makes everything simpler. If a programmer wants an unsigned type, he can do it himself.
I'm a Java developer - naturally I think Gosling (for the most part) drew the lines in the right places.
Any new features that make it into Java or C# will only make the tutorials longer and the learning curve steeper. Not a good thing.
It's not like several other languages that have to go and add unicode support on later as an afterthought.
new Thread()
{
public void run()
{
System.out.println("I'm in a Thread");
}
}.start();
In C#: new Thread (Go).start();
static void Go()
{
Console.Writeln("I'm in a Thread");
}
...C# isn't especially elegant either, but the general uncleanliness of inner anonymous classes is one example of Java's problems. new Thread(() => Console.WriteLine("I'm in a Thread")).Start();This isn't the only difference, either. C# is never going to be as terse as a scripting language, but with each release they are examining common workflows and streamlining them. Java may be adding in a lot of new features, but the syntactic integration seems awkward at best.
The little things count for a lot.