C# – Is C# actually a multiplatform language

cmonomonodroid

C# (and the .NET platform in general) is looking like it's becoming a good option form multi-targeting applications:

  • official Microsoft .NET framework: full-blow Windows development, ASP.NET development, Windows Phone development, etc.

  • Mono and all its derivatives: MonoTouch, MonoDroid: the rest of the world. These tools are today RTM.

  • Does it mean that C# is becoming a good language for targeting the most popular platforms, desktop, web, and mobile?

  • Is it still better to use the "native" language of target platforms (Objective-C, Java, etc.)

  • Is it only a screen of smoke and only marketing language?

Please note that I'm actually conscious I won't able to copy/paste the code between platforms. But I'm sure the lower layers of applications (models, business, etc.) can be reused, but I know I'll have to adapt the higher layers (GUI, etc.) to the platform. My goal is more focused on required skills than technical code sharing.

I am a C# developer in a company that massively uses C#. That's why I talked about C# in a plan to expand the range of target platforms in my company.

Best Answer

Yes, in general, the .NET Framework is great for apps that target a broad range of devices. But this isn't unique to .NET; Java was doing that long before. The thing to keep in mind is that there's no real alternative to the native tools for a particular platform.

The Mac applications that you create with .NET will never look like native Mac OS X applications, and that's considered a problem by the vast majority of OS X users. That may not be important to you strategically, depending on whether your business model values maximizing saturation over maximizing user satisfaction, but it's certainly something to keep in mind when making a choice.

The GUI systems in Linux and Windows are somewhat more flexible in terms of which applications look "native" and fit in well with the platform. But I blame that mainly on the lack of clear interface guidelines and the fact that application developers have historically been willing to ignore the ones that do exist. Many Mac users prefer the Mac precisely because of its consistent user interface.

Considering that you'll have to adapt the GUI layer to the specific platform (and possibly rewrite it in a different language entirely, such as Objective-C), that leaves you leveraging the .NET platform only for library code. And then there's not a very clear win for C# over C++, in my opinion.

For rapid application development, there are few alternatives that are better than C# and .NET. And pushing an app out quickly and having it immediately available on a diversity of platforms is certainly a business advantage. But for true multi-platform applications that aim to truly satisfy the user, it's not necessarily the silver bullet solution.

Related Topic