C#, C# in unixes, or Mending Java

SaintCahier's picture

I am getting progressively frustrated with the limitations of Java, and the new C# 3.0 looks *really* fun (grown up genericity and those functional language extensions seem exciting). However I wonder if it is wise to invest my time on a language which works only in *one* operating system (Java's portability has spoiled me).

An alternative, of course, would be building a combination of personalised classloaders to try to mend the most obvious inneficiencies of Java (all those useless boxing/unboxings), but I don't know how feasible that is...

 What do you think?

javaman's picture

"but if you develop for Mono ..."

I think it's ok as long as  Saintcahier knows the constraints of what he would be using (as he says it's for research I don't think he would be needing a lot of services from the Win platform).

I think you should read about the new things in both languages, since they're very interesting (check out VB too, it has new stuff for XML  ;) ). If you're planning to share your package or assembly, I'm sure you or other colleague  might rewrite it  for his/her's needs in other language, as long as they understand your algorithm from the source code.

Smile

Mono...really

Sure, but you seem to be looking from the perspective of Mono being some kind of compatibility layer rather than a platform by itself. That is somewhat the intention of course, but if you develop for Mono rather than .NET then whatever Microsoft thinks on the matter is irrelevant, and that is how I see it.

I always wanted to like Java - in theory it seemed perfect, and I've given it a go time and time again, I'm Sun Java certified and so on, but without wanting to start on pointless java-bashing, I just don't like it and stopped using it a while ago.

If other people like it then fine, and as you suggest "horses for courses" is always the best rule. But I wanted to add that I find C# and the Mono framework a perfectly good and viable cross-platform alternative, and I mean that in a very "real" sense.

javaman's picture

Let's Get Real ==MS Interests

I'll just say that I have been with some softies (as Microsoft employees like to call themselves) and well, they are not very enthusiastic regarding compatibility with other non Windows platforms, even for web services!! (Such as with the Metro Project).

A lot of functionality such as transactions, some crypto providers, and services are based on Com+ services, Win Services, and other Windows specific services and products.

On the other Side, Java uses specs an lets vendors to implement the functionality in however they want to (maybe even use JNI!!) , so I think you'll have a better chance with Java for portability.

As I said before, I'm an IT agnostic (I'm both certified in .Net & Java Technologies) and I think you should use the stuff that will be better for each situation. You can't expect to have a one-solution-fixes-all technology. =)

I use C# on Linux over Java

I haven't touched MS platforms for over 2 years now, but I always go with C# in preference to Java on Linux. What do you mean by "let's get real" regarding Mono?

SaintCahier's picture

Scala looks very impressive

Scala looks very impressive and promising.

Clojure looks like yet-another-dialect-of-Lisp and I have little more regard for Lisp than I have for TeX. On a brighter note, I've had never heard about this STM thing and it looks indeed fun-tas-tic!

The issue is that *one* of my intentions with those libraries is to share them with the scientific community, not only in the sense of a "a module to be used" but mainly in a "a module to be read". Using some esoteric language like Scala, even if it is the state-of-the-art, would perhaps make this more difficult? (Though I guess anyone acquainted with C++ can reasobly guess the purpose of code in C#, Java, or even Scala).

akamaru's picture

Actually you can use C#

Mono has an excellent C# compiler that supports v1, v2, and v3 of C#. I believe the newest compiler even has support for LINQ and lambdas. And the mono compilers certainly run under linux. If memory serves, there's reasonable WinForms compatability in Mono, along with bindings for GTK.

If you want to stick with the JVM I would suggest looking at Scala and Clojure. Scala is statically typed, but has a cool type inference system. There are some occasional corner cases, but over all Scala is close to what I wish Java was. Clojure is dynamically typed and Lisp-like, so that may or may not be to your liking. Both have extensive support for functional programming. Both have some very cool support for concurrency. Clojure also has a Software Transactional Memory implementation, which I've only otherwise seen in Haskell. 

javaman's picture

There you go!

If you need the UNIX compatibility  I think you will have to look  to Java, maybe Kylix (Pascal-Delphi version for Linux not discontinued from Code Gear -Borland) or have a look to other not so "popular" languages like Python or Ruby.

Indeed Java is such a powerful and robust  language and  platform for so may things from mobile device  to enterprise business development that it does need the compatibility, however you might benefit from the new features as well.

What version of Jave are you using and what kind of complex type features are you interested on?

SaintCahier's picture

I am not exactly an IT

I am not exactly an IT professional, but an academic researcher, so my perspective is somewhat different. I like the direction C# towards is moving (sophisticated type system, hybrid functional - object language resources, real genericity on runtime --- without type erasure, etc.) but I have to stay compatible with UNIX: that's where 90% of academic experiments are run.

 I like Java because you don't have to worry about memory disposal, the standard library is reasonably adequate, and both the code and the data are very portable (which is very comfortable when you are developing in a Windows box and then running some experiments in a Sun workstation and some in a Linux box).

But Java emphasizes backwards compatibility and simplicity of the language design a tad too much for my tastes. I would like it to have a more complex type system, and I finding the management of the division of the world into simple types <-> object type very tiresome.

javaman's picture

It's up to you!!

There are seriously  real nice stuff in C# and VB now in .NET 3.5.  and I think it's very interesting to learn how the new pieces of this new features will be use to enhance the development such as LINQ. We know there's Mono as a project for Linux platforms....but let's get real  =P .

Java offers generics too, so I guess it really depends on your needs (I'm an IT agnostic, so I'm not going to be in "one's party side" ).

Where are you planning to use this? What's the actual IT vision of the place where you are using it? Will you be targeting a Windows platform?

Be like that new Hannah Montanna girl from Disney and think to use "the best of both worlds!".