The Benefits of C# and .NET — Even on macOS

HALLAM: C# is an excellent language to learn for a number of reasons. It is syntactically similar to several other mainstream and well-established languages such as C (obviously 🙂 ), C++, and Java. Java and C++ are also object-oriented languages, so those skills are transferable. C# uses the .NET Core runtime stack making applications cross platform as .NET Core is supported on macOS, Linux, and obviously Windows. Because .NET and C# go hand in hand, .NET skills are easily transferred to other languages like Visual Basic.
HALLAM: There isn’t much you can’t build with C#. Depending on the framework, you can target mobile, Android, and iPhone using Xamarin, website, and services with ASP.NET and the Windows desktop. You can even develop for the macOS desktop using Visual Studio for mac in conjunction with Xcode. There are even open source platforms for developing desktop GUI apps for Linux. C# can be used for XBOX game development, and even low-level PCB programming.
HALLAM: Apart from cross-platform development, it is a mature and well-supported language with a vast array of libraries supplied by Microsoft and third parties. One of its main advantages is the excellent tooling in the form of Visual Studio for Windows and macOS and cross-platform VSCode with the C# extension.
HALLAM: Short answer: no. I moved from Delphi, after initially learning Pascal, to C#. Delphi is similar in terms of being object-oriented, but syntactically a little different. Since programming in C#, I’ve written code in C++ and Java.
HALLAM: If you’re developing exclusively for the Mac desktop, then I can’t think of a good reason, but who does that? Cross-platform and online services are the future for most development, and the combination of C# and .NET Core has those bases covered.
HALLAM: As an example of its extreme versatility, I developed software that controlled an industrial vending machine and the Azure-hosted web services the vending machines communicated with. So, that’s code controlling hardware on the machine and synchronizing stock and sales data with an Azure-hosted database application. I also built a website for people to manage and report on their vending machines.
HALLAM: C#, .NET, Visual Studio and Azure are all Microsoft technologies, so there is tremendous integration between them. When you throw in Azure DevOps, you can have a seamless CI/CD pipeline allowing you to very easily manage the software development life cycle employing agile techniques. It’s the tool integration that I like the most. The ability to create and deploy apps from within the Visual Studio environment. Apart from web services and websites, almost all Azure services allow custom code support C#, ranging from Azure functions to IoT event hub triggers.
HALLAM: Getting Started with Azure App Service details several easy ways to deploy an application to Azure from Visual Studio. App security has never been more important and Managing Application Configuration and Secrets describes how to develop applications with flexible and secure configurations within Visual Studio. Visual Studio can securely access Azure-based resources, and that secure access is seamlessly transferred to the cloud when deploying to Azure.
HALLAM: From a technical perspective, Java is comparable in both syntax and the use of a runtime environment to allow applications to run on multiple platforms. Python is popular due to its shallow learning curve and that it’s not perceived as being aligned to a big tech company. I think there is this perception that using a Microsoft product is somehow going over to the “dark side” and you are in some way betraying the open-source ethos. Nothing could be further from the truth. .NET is now pretty much open source and very good and well-supported development environments are free. There is nothing stopping someone from using C# and .NET along with freely available databases from building a production-level system.
HALLAM: Depends what you comparing C# to. If it’s an interpreted scripting language like Python, then no. C# and .NET run on Linux. Many of the demos I’m doing in the Introduction to C# learning path are on a Linux box. C++ is always going to be the go-to language for getting down and dirty with the operating system and achieving ultimate performance, but that performance needs to be traded off against development productivity. C++ is a more complex language but is the syntactic origin of C#.
HALLAM: The only place C# falls short is GUI desktop development for Linux and macOS, although there are apps that are addressing this issue with greater sophistication. C# is continually being developed, refined, and adapted to new platforms. A relatively recent and exciting platform addition is Blazor, allowing C# developers to build Web Assembly apps to run in the browser, sometimes with functionality complementary to JavaScript, or sometimes completely replacing JavaScript.