Tag Archives: Mono

Could C# be the one language to rule them all?

Being a developer, it is important to continue to learn about new languages as you are being asked to create solutions for multiple platforms.  The reason why we have so many languages is because on a hardware level each CPU uses a different assembly language to run their instructions.  Due to this fact not every language is able to run on every platform.  For this to work you would need to have multiple companies that are able to understand these CPU differences to write compilers for the same language.

Java_1

For a time, the language Java (which as owned by Sun Microsystems for a time until Oracle purchased the company) was set out to solve this problem.  From 1995 through the mid 2000’s it seemed like Java was supported on almost every computer and device.  That was until the iPhone come along with its first version of iOS in 2007.  It wasn’t unusual that a new device didn’t have support for Java on the initial release but then Apple announced that they will never support languages like Java (http://www.iphonefaq.org/archives/9731).

The reason is because their terms of use do not allow developers to create apps that were written from interpreted code.   So that means you are only able to create apps that are written in a low level language like Objective-C which create compiled programs.  This was bad news for developers as there was one more language that we needed to learn.

The folks over at Google decided on using Java (although you can also use C++) to write your mobile apps for their Android operating system.  Meanwhile Microsoft relies on their .NET Framework to create Windows Mobile apps which includes the Visual Basic .NET and C# languages.

By now you see the problem.  If you wanted to write a mobile app for each of these platforms, you would need to learn three different language on three different frameworks.  Wouldn’t it be nice if someone created a new language and would allow programmers to create apps for all of these types of devices?  Well the short answer is no.

xkcd-standards

The solution to this problem has been solved for us already by the Mono group (http://www.mono-project.com/).  The Mono project was started back in 2004 as an open source project to port the .NET Framework to run on Linux and Mac.  This project was original independent from Microsoft but now it is being included in the latest version of its developer environment: Visual Studio 2015.

VS2K15_1

This is all possible because of Xamarin (http://xamarin.com/) which takes the ported version of the .NET Framework and uses it build apps that run on both Android and iOS devices.  However it isn’t perfect.  For instance, in order to create iOS apps in Visual Studio 2015 you are going to need to purchase a business account from Xamarin ($89/month) plus have access to a Mac.  This will then create the compiled programs that iOS will allow to run on its devices.

Also the version of the ADK (Android Development Kit) that is included with Visual Studio 2015 isn’t the latest version so you will need to manually go out and download and configure the latest version on your machine before you are able to create Android apps.  At any rate you will be prompted to log into Xamarin.  You can find more information about this here: https://www.visualstudio.com/en-us/features/xamarin-vs.aspx.

Not exactly plug in play, but it is still early days.  Hopefully, future versions of Visual Studio will allow developers access to a more “turn key” solution for creating mobile apps in a single programming language.