Microsoft C#: 8 Reasons to Use it for Mobile Development
Asynchronous programming is a first-class language feature and turns what is typically regarded as boring, repetitive and error-prone coding into a more simple experience, Friedman said. And anonymous types, lambda expressions, type inference, functional-style programming and LINQ allow developers to write code that is highly expressive and easy to maintain.
Object-oriented programming and encapsulation make it easier for developers to structure code for maximum reuse. Capabilities like reflection and dependency injection offer developers a lot of power and flexibility.
Garbage collection greatly simplifies development by eliminating the cognitive overhead of manual memory management. Developers can focus on solving problems that matter, instead of fighting with pointers.
makes it faster and easier for programmers to detect and isolate bugs at compile time, which is an especially important characteristic in mobile development, where the build/run/test cycle is lengthened by the need for specialized packaging and deployment to a device or emulator. With compile-time sanity checking, C# developers don't have to wait until their program crashes to find obvious errors.
Easy to Adopt
Friedman said C# is an easy language to learn, especially for developers who are already familiar with the principles of object-oriented programming. The enormous body of available C# reference material ensures that new developers never get stuck, he said.
C# on Apple's iOS is powered by the LLVM optimizing compiler, the same backend used by C and C++ that powers the operating system, giving developers the best of both worlds: the high productivity of C# and the performance of a low-level language. On Google's Android, C# performs better than Java both because of language design choices (support for value types, real generic types and nonvirtual method defaults) and the more mature Mono runtime, compared with the relatively young Dalvik, Friedman said.
Seamless interoperability with native code gives developers the best of both worlds. You can bind native libraries and leverage the power of P/Invoke to expose additional functionality to the world of managed code. This is how Xamarin has exposed 100 percent of the native APIs on iOS and Android to C# developers, giving them access to the full expressive power of the underlying platform, as Rdio recently demonstrated with their C#-based iOS and Android apps, he said.
Between Windows, iOS and Android, developers' C# code can run on more than 2.2 billion devices. In addition, beyond mobile, C# is highly portable in a wide range of environments across the spectrum of mobile, embedded, desktop and server computing, Friedman said.