3 ms·
C# is a good production language. It lets twiddle you your bits almost as well as C when you need to, provides a decent OO model, and has been piling on more fu
by sreque 15y ago
C# is a good production language. It lets twiddle you your bits almost as well as C when you need to, provides a decent OO model, and has been piling on more functional and dynamic features as the years go by. However, as someone who has had to port a .Net C# app from windows to Linux, I can witness with sincerity that C# is NOT very portable.
First of all, a lot of the C# APIs are written with windows in mind. An example is system mutexes. These just don't exist on Linux, and the mono implementation to emulate them is very buggy. Another example is the process counter API. Although much of this same information is available on Linux via the Proc table, Mono provides no equivalent API because it would be a lot of work to make one that works on all the Unix variants. There are many such examples of C#'s windows-centric API not being ported well in Mono.
A bigger problem with Mono is that it just wasn't stable for us. The more standard library features we used, the more it would core dump on Linux even though it would never crash on windows. We ended up re-implementing a lot of functionality available in the standard library ourselves before the program stabilized on mono, which further incriminates the Mono stack. As a final note, we tried multiple versions of Mono, including 2.4, 2.6, and 2.10, and none of them worked well for us.
If you want to write a fairly performant cross-platform app, the JVM is still a much better place to play in right now than .Net, even though I like C# the language a lot more than I do Java. You can also go the route of combining your favorite scripting language with C for the CPU-intensive parts.