Linked by Thom Holwerda on Sun 12th Jul 2009 21:29 UTC
OSNews, Generic OSes Even though news has been slow the entire week due to the fact that it's summer and people are more interested in vacation than in technology news, we still had a lot of interesting stuff this week. Google obviously captured the headlines with its Chrome OS, but we also talked about Mono, Richard Stallman, and many other things.
Thread beginning with comment 373105
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[4]: Mono
by tuttle on Mon 13th Jul 2009 13:46 UTC in reply to "RE[3]: Mono"
tuttle
Member since:
2006-03-01

Superficially C# is very similar to C++. But many of the things you take for granted in C++ are impossible in C#.

For example there is no mechanism for deterministic deallocation of resources.

There is not a single feature in C# that applies to all other parts of the language. For example, you can not use operators when using interfaces. You can have instance extension methods, but not static extension methods. You can not do any calculations on generic type parameters. The list goes on and on.

C# started as a decent java-inspired language that did some things better than java. But nowadays it is just a horrible pile of nonorthogonal language features.

I will take java any day over C#. A simple language with complete and comprehensive library support is preferable to a kitchen sink language like C# where every new technology fad results in an extension of the language.

If you want a modern JVM based language, take a look at scala.

Edited 2009-07-13 13:52 UTC

Reply Parent Bookmark Score: 3

RE[5]: Mono
by modmans2ndcoming on Mon 13th Jul 2009 17:25 in reply to "RE[4]: Mono"
modmans2ndcoming Member since:
2005-11-09

non-deterministic resource deallocation? Welcome to garbage collection.

As to your other complaints... welcome to functional programming.

Seriously... you want to add a static method to an instance variable? do you plan to allow the dynamic creation of a new class?

Reply Parent Bookmark Score: 2

RE[6]: Mono
by flynn on Mon 13th Jul 2009 18:32 in reply to "RE[5]: Mono"
flynn Member since:
2009-03-19

As to your other complaints... welcome to functional programming.

His other complaints had nothing to do with FP.

Seriously... you want to add a static method to an instance variable? do you plan to allow the dynamic creation of a new class?

No, he wanted to add a static method to an existing class without subclassing or recompilation. Currently C# allows you to only add non-static methods to existing classes. Which seems like a pretty artificial limitation.

Reply Parent Bookmark Score: 1

RE[6]: Mono
by tuttle on Mon 13th Jul 2009 19:09 in reply to "RE[5]: Mono"
tuttle Member since:
2006-03-01

non-deterministic resource deallocation? Welcome to garbage collection.


Garbage collection has nothing to do with it. If an object (like a file or a GDI brush) has some resources associated with it, I want them to be deallocated immediately when the object goes out of scope, and not a few minutes later when the object is garbage collected.

There is the IDisposable interface and the using(...)-Pattern, but there is no way to enforce this. That is why C++ (even managed C++) has destructors that get called immediately. RAII is tremendously useful, but impossible to do safely in C#.

As to your other complaints... welcome to functional programming.


What does that have to do with functional programming? C# is not a functional language. It is just a language that took a few features (closures) from functional programming without understanding the big picture. For example, the biggest property of functional languages is referential transparency. But it is very difficult to ensure immutability in C#. In fact most language patterns (property and array initializer syntax) encourage mutable objects.

Scala has none of the deficiencies I mentioned and is much more functional than C#.

Seriously... you want to add a static method to an instance variable? do you plan to allow the dynamic creation of a new class?


I want to be able to add a static method to a type. To be precise, I do not want any static methods in the first place. I would prefer the scala approach.

But if you have a language feature like static methods or interfaces you should make sure that other language features (operators, extension methods) work together with that feature. Otherwise the language is nonorthogonal, which is just bad design.

Reply Parent Bookmark Score: 2