One morning around Easter I was bored and had an initial look at C#. Today, after nearly amputating one of my toes (but that's another story), I think the world has a right to know about the results of my Easter-C#-expedition:

Because I'm an adventuresome guy, I opted for Mono's compiler/class library/runtime stuff instead of the Microsoft SDK.

Knowing Java relatively well, the C# syntax wasn't that hard to get for me. In fact, a big part of it looks exactly like Java. Apart from the obvious differences like Class1 : Class2 vs. Class1 extends Class2, the thing that bugged me most was the different method naming convention. Java supports the traditional camel-style notation (getFoo()), while C# resp. the .NET/Mono class library uses method names where the first character is an uppercase letter (GetFoo()). This may not be a big problem for other people, but I needed to write a number of lines of code to get used to it.

Speaking of the class library, it was nice to see that the Mono folks have done a great job in duplicating implementing the original .NET class library. So far I used the IO and Crypto parts of the Mono library, while using MSDN as my reference and I was unable to spot any inconsistency between the two. Thanks ECMA.

Using the compiler is as easy as pie: mcs foo.cs. That's it. (I admit that this surely isn't exhaustive, as the compiler accepts something like 20 additional arguments.)

Executing is a bit cumbersome for people being used to "single-word" binaries: Instead of just executing the emission of the compiler, one has to use mono foo.exe. (This only applies to Mono users, of course.)

Written on 17 Apr 04 07:49 PM.