C# in Linux, iOS and Android

C# programming in Linux is not very developed compared to that in Windows. We do not want to completely skip it, so we will give some guidelines on how to start programming in C# in Linux, iOS and Android.

The most important thing that we need in order to write C# code in Linux is a .NET Framework implementation. Microsoft .NET Framework is not available for Linux but there is an open-source .NET implementation called “Mono”. We can download Mono at its official website: http://www.monoproject.com. Mono allows us to compile and execute C# programs in a Linux environment and on other operating systems. It contains a C# compiler, a CLR, a garbage collector, the standard .NET libraries and many of the libraries available for .NET Framework in Windows like Windows Forms and ASP.NET. Mono supports compiling and running C# code not only in Linux but also in Solaris, Mac OS X, iOS (iPhone / iPad) and Android. The iOS version (MonoTouch) and the Android version of Mono (Mono for Android) are commercial projects, while Mono for Linux is open-source free software. Of course, Visual Studio does not work in Linux environment but we can use the #Develop or MonoDevelop as C# IDE in Linux.

Other .NET Languages

C# is the most popular .NET language but there are few other languages that may be used to write .NET programs:

·         VB.NET – Visual Basic .NET (VB) is Basic language adapted to run in .NET Framework. It is considered a successor of Microsoft Visual Basic 6 (legacy development environment for Windows 3.1 and Windows 95). It has strange syntax (for C# developers) but generally does the same as C#, just in different syntax. The only reason VB.NET exists is historical: it is successor of VB6 and keeps most of its syntax. Not recommended unless you are VB6 programmer.

·         Managed C++ – adaptation of the C++ programming language to .NET Framework. It can be useful if you need to quickly convert existing C++ code to be used from .NET. Not recommended for new projects. Not recommended for the readers of this book, even if someone has some C++ experience, because it makes .NET programming unnecessary complicated.

·         F# – an experiment to put purely functional programming paradigm in .NET Framework. Not recommended at all (unless you are functional programming guru).

·         JavaScript – it may be used to develop Windows 8 (Windows Store) applications through the WinJS technology. It might be a good choice for skillful HTML5 developers who have good JavaScript skills. Not recommended for the readers of this book because it does not support Console applications.