Thinking In .NET
A place to learn about C# and the .NET Platform by Larry O'Brien. But mostly the obligatory braindump cross-linking that characterizes the blogsphere.
        

C# versus Java: Is the Language I Choose Important?

This is an article I posted to the DOTNET-CX list on January 10, 2003:

> (1) Java folks seem to be obsessed with the C# language and the

> syntax. Are they missing the point?

Well, it depends on which point you're aiming at. They are certainly missing one point, which is that the stability, performance, and comprehensiveness of the library contributes _at least_ as much to overall productivity as the language itself; for instance, Java has a library for P2P programming, while .NET does not, so Java is going to be more productive in that area. On the other hand, .NET's XML libraries are comprehensive and highly optimized, so .NET solutions might tend to run faster than Java ones. Now, if you ask me, the _point_ of this observation is that it is possible for these types of advantages to be transient -- a few sharp, motivated programmers and the _technical_ table is turned. For instance, jUnit is a unit-testing tool for Java and was better and moer advanced than nUnit 1.0, which was the .NET port. But then, nUnit 2.0 came out and is better and more advanced than the current jUnit. Perhaps the next release of jUnit will reverse things again. When it comes to libraries, competition (whether for money or the esteem that OS people advocate) is absolutely beneficial.

On the other hand, computer language and syntax deserves much more attention than it normally gets. I'm biased (I used to edit a magazine called _Computer Language_), but I strongly believe that an important part of the software development world stalled in the 1990s with the acceptance of object-oriented, imperative languages as some kind of "ultimate" syntax. Such a stance is ridiculous. We will no more be using class declarations and dot-syntax in 30 years than we use punch-cards today. Already, aspect-oriented programming is gaining some traction as raising and addressing some limitations of the object-oriented paradigm and intentional programming, while still largely under wraps, may be an even greater contribution.

There is a widespread perception in the Java community that "C# is Microsoft's clone of Java." This is not accurate, for historical and technical reasons, but it is a fact that C# and Java are syntactic siblings. They share most of the same constructs and facilitate the same types of thinking. A solution crafted in C# would likely share the same overall structure as a solution crafted in Java (barring a library-based solution available to one language such as mentioned above). So it's an interesting question to ask whether the syntactic differences between the two make a significant difference to productivity and, if so, which language benefits. I worked with Java from before its first public beta (I was the first non-Sun employee to write a technical article on it; wrote whitepapers for Sun; was a columnist for "Java Pro," etc.) and it's my opinion that C# is an incremental but real improvement over Java at the syntactic level.

At the infrastructure level, though, there is little doubt that the CLR and the .NET strategy is _vastly_ more conducive to the evolution of programming systems. By creating an infrastructure that facilitates multi-language programming and provides universal access to libraries, the CLR addresses the greatest impediments that computer language innovators face. This is a strategy that Sun _could have_ chosen, but instead has chosen to focus on the Java language and standard library and not the JVM as the foundation for evolution. Thus, for instance, Sun's decision to sue Microsoft over Microsoft's alternative to the Java Native Interface: clearly, interop in .NET is vastly easier than JNI. As innovations emerge (perhaps from academia, perhaps from a pair of programmers working in a virtual garage), more issues like this will arise; Microsoft's strategy is to encourage such things directly, Sun's is to place them in the Java Community Process, which like all bureaucratic processes tends to dampen the fires of innovation.

> (c) What is your feeling about the importance of the languages?

> (d) If one insists on being concerned about languages,

> should not one focus on VB instead? I hear that VB is much

> more pervasive than C#.

I would argue that by focusing on current languages, you're ignoring historical, social, and technological evidence that the programming world is currently in a back-eddy of a much larger stream. The activity of computer programming is laughably inefficient at exploiting computer power. Compare computer programming to publishing: we are still in the era of linear streams, while direct representation and manipulation transformed publishing more than a decade ago. I cannot predict the exact form of future programming systems, but there is no doubt that they will be multi-representational and feature direct representation and manipulation. Rational XDE is perhaps the beginnings of such a system, but it (like all popular tools) ignores many alternative models of programming that are known to be productive in certain domains. What we need is an infrastructure and toolset that provides alternative programming models where applicable, where systems-level programmers can work in low-level languages such as C and C++, component-developers in high-productivity languages such as C#, and business people with tools they find productive and intuitive (such as spreadsheets). And that's just what we need _now_! Who knows what we will need in another decade! Microsoft's .NET strategy -- from the CLR, to alternative form-factors such as the tablet, to the .NET server software, to the next version of Office -- is much, much better aligned with this larger historical context than Sun's Java strategy. Arguing whether keyword "synchronized" is better than keyword "lock" is all well and good, but it's irrelevant to why .NET is going to become the dominant platform for software development.

Larry O'Brien

Author, "Thinking in C#" (/ticsharprc1.htm)



© Copyright 2003 Larry O'Brien. Click here to send an email to the editor of this weblog.
Last update: 1/10/2003; 10:39:17 AM.