C# (pronounced "c-sharp") is a great coding language that works across Mac and PC. Programmers use C# to build a variety of applications, especially in the Windows environment.
C# is only one language inside Microsoft's .NET framework, but since Windows 8 it's become the biggest one. Windows developers head straight to C# for building applications on Windows desktop.
In this feature we'll look at the following:
- Learn C# in OS X: what is C# and why should you learn to program in it?
- How to set up C# in OS X
- Set up MonoDevelop IDE in OS X
- Learning C# in OS X
So why would you want to learn C# on a Mac? There are lots of reasons for flexing your coding skills towards C#. While C# is tied to the Windows environment, it's cross-platform so that you can learn it just as well on a Mac as a PC.
Even if you're a Mac person through and through, C# is an excellent programming language, with modern features such as Delegates, Yield statements, and Lambdas. Microsoft is firmly behind mobile and desktop development, and it's the future of development on Windows. It's worth learning C# if you ever plan to develop programs for both OS X and Windows, or to take apps from one platform to another.
Plus, even if you're an Apple fan, it's always good to see what the competition is up to.
Learn to code with C-sharp on Mac: Set up MonoDevelop to create C# programs on a Mac
Visual Studio Code is perfect for writing C# programs, but you can't compile and run them. It's a code editor, not a full IDE.
To compile and run C# programs you'll need an IDE, MonoDevelop is the one to get. Download a copy of XamarinStudio (MonoDevelop coupled with Xamarin iOS/Android plugins) from the MonoDevelop website:
- Go to MonoDevelop and click Download Xamarin Studio under OS X.
- Double-click "XamarinStudio-184.108.40.206-0" (or later) in the Downloads folder.
- Drag Xamarin to the Applications folder.
- Double-click Xamarin in the Applications folder.
- Click Download Mono Framework. It will open the Mono Project.
- Click Download Mono Universal Installer.
- Double-click "MonoFramework-MDK-220.127.116.11.macos10.xamarin.universal" file to open it.
- Click Continue and follow the Mono Framework installer instructions.
When the installation has finished, return to the Applications folder and open the Xamarin Studio library again.
Sign up for CIO Asia eNewsletters.