In this brief post, the 5th of the series, we will analyze why it’s relevant that Xamarin is build around C#! 🙂
Well, starting from basics, one of the main advantages of C# are the support of LINQ, which allows you to execute queries and select data from arrays and databases like SQLite. An example of LINQ:
Moreover, in C# you can easily manage Events and Delegates:
And you can work with IntelliSense and Lambda expressions!
Also, C# natively supports JSON through the Json.NET library. Json.NET offers simple conversions to and from JSON strings and .NET objects, with SerializeObject and DeserializeObject methods.
Here is an example of creating a class with a method to get names:
In C#, one line with LINQ is used to execute the whole command. Also, the C# class takes advantage of C# features and set properties easily.
Last but not least, the Async/Await constructs will allow you to set up a multithreading environment with the lowest effort possible. Below here a comparison between the Async/Await and the same code written in Objective-C!
See you on the next post! 😀
Happy coding! 🙂