I mentioned the decision to implement Toves in C# earlier, leaving discussion of C# itself for later.
I came to C# after years of developing in Java, including Logisim but also several other smaller projects. I had grown familiar familiar with Java. Since C# is quite similar to Java, I expected the adjustment to be easy. And while it has been straightforward, it’s been more involved than I expected. The two languages do have some key differences.
Overall, the differences are just that C# has more features – the language has evolved at a more rapid pace than Java has. Some features are nice, others just aren’t very useful. I particularly like properties, language-level event support, and anonymous functions. Also, extension methods are a nice idea that works better than I would have expected.
What I miss most from the language is Java’s package-level protection. Instead, C# has “internal,” which allows access across all namespaces in the assembly, which is more permissive than is useful. I’ve ended up doing some ugly work with “keys,” which some objects generate and which other classes demand in order to perform a method. What I’d really like is “friend” classes such as C++ has, but only members specifically marked as for friends (“shared”?) would be available to them.
My complaints about C# have to do mostly with the infrastructure. First, as I already mentioned, I haven’t yet figured out a way to make it easy to install and execute Toves across multiple platforms. I’m sure there’s an answer, but it’s not there yet.
The libraries are decent, but I miss the JavaDoc API reference. Mono’s documentation is too spotty to be competitive. The MSDN documentation is reasonably complete, but it’s not as easy to navigate as JavaDocs. For GTK#, I find I often have to go to the original GTK+ documentation of the C API and then guess how it might have been translated into the GTK# API.
There’s also the matter of the development environment. I’ve heard that Visual Studio is impressive, but I’m developing on a Macintosh, so I’m using MonoDevelop. It’s a passable development environment, but I miss Eclipse. One persistent though simple missing feature: It’s difficult to view compiler error messages in their entirely. Another is that the IDE seems to pause unreasonably at times, even when code completion is turned off.
Overall, though, I’ve been happy working in C#/Mono, just as doable as Java.