As a heavy Windows-centric developer, I recently bought a new Macbook Pro (just before the new 16" was launched!). It was my second time using Mac. The first time, I used only Windows through Bootcamp. This time, I'm trying to migrate my development experience to Mac from Windows as a .NET developer. It's still on-going, but I wrote a couple of toy projects on Mac OS. I think it's good to share my personal experience of how I did the transition from Windows to Mac.
Basic Development Environment Setup
I had no idea where to start to set-up the development environment, for the first time. But I found a good post (in Korean) for the initial setup. Therefore, I just followed most of the setup instructions from the post.
One of the most frustrating moments when switching to Mac from Windows could be the keyboard layout. The layout of the Control key, Option key and Command key is completely different, and I don't think I'm going to be used to the layout anytime soon. Therefore, I have to remap those keys to continue my Windows development experience.
Karabiner-Elements is a completely free app. It is really excellent for key remapping. I used this for my keyboard layout realignment.
FnKey: Changed to Left
ControlKey: Changed to
CommandKey: Changed to Left
CommandKey: Changed to
After this remapping, both the left
command key and
fn key combination gets pretty similar to the one in Windows. Therefore, the
V sequence have become really natural. By the way, what's the purpose of the right
Command Key mapping to
System Keyboard Input Source Shortcut
F13 key doesn't exist on Windows. I don't know how this key is used on Mac, either, but it seems to be a reserved key for another purpose. As a bilingual developer, I switch both Korean and English every 5 to 10 mins. And this IME switching on Windows is the right
Alt key. Therefore, I remapped the right
Command key to
F13 and changed the input source switch shortcut to
F13 like below:
Now, I have the exactly the same experience as Windows to change the input language source.
Better Snap Tool
Mac OS provides the screen split view feature, but it's fairly basic. If I want more, I need to look for a third-party tool. Better Snap Tool is precisely for this purpose. It doesn't only provide a screen split view from many different perspectives but also provides shortcut features for each split view. The only downside of this tool is that you have to buy this.
Of course, there's an open-source-based tool doing the same thing, like Rectangle. If you're cost-sensitive, it's worth considering.
.NET Core SDK
.NET Core has now been older than three years as a cross-platform and open-source language and framework. The latest version of .NET Core SDK is
3.1.100 (3.1.0) at the time of this writing. You can download it from the official website. If you prefer to using Homebrew, type the following command to install the latest version of .NET Core SDK.
|brew cask install dotnet-sdk|
But, there's a slight issue using Homebrew to install .NET Core SDK. The Cask only contains the latest version of SDK. It's common to target a different version of SDK when developing .NET Core applications. For example, We can write a console app with .NET Core 3.1.0, but at the same time, we might need to develop an Azure Functions app that currently has a target to .NET Core 2.1/2.2. In this case, we have to download and install manually, not through Cask. Fortunately, there's a Tap, called .NET Core SDK Versions. Follow the command below to install multiple version of SDK.
|brew tap isen-ng/dotnet-sdk-versions|
|brew cask install <version>|
With this Tap, the following command will show up the list of installed .NET Core SDK.
PowerShell used to be a scripting language, only running on Windows. It's now open-source and supports cross-platform. Therefore, you can continue the existing PowerShell scripting experience on Mac. Use the Homebrew command to install PowerShell on your Mac.
|brew cask install powershell|
Once installed, your default Terminal app turns into the PowerShell mode. If you change the theme of Terminal, it will really give you the same PowerShell console look and feel.
In addition to that, installing Azure PowerShell Module will give more seamless integration by typing the command below:
|Install-Module -Name Az -AllowClobber -Scope CurrentUser|
Like Azure PowerShell, Azuer CLI is a cross-platform tool that manages Azure products and services. While developing applications running on Azure, both Azure PowerShell and Azuer CLI are necessary because they complement each other. Therefore installing both would be a good idea. To install Azure CLI, run the following command:
|brew update && brew install azure-cli|
Azurite is an emulator for Azure Storage, and an
npm package that running on multiple platforms. If we develop an Azure Functions app, we mostly need Azure Storage account. On Windows, we can use Azure Storage Emulator for local development, but we can't use it on the other platform. Therefore, Azurite is really a useful tool running on cross-platform. At the time of this writing, its latest version is
3.3.0-preview, but it's not stable yet. So, I would recommend using
|npm install -g email@example.com|
Once installed, run the following command in the console.
|azurite --silent --location ~/azurite --debug ~/azurite/debug.log|
Azure Storage Explorer
Azure Storage Explorer helps navigate both local and cloud storage services like Azure Storage Account, Cosmos DB and Azure Data Lake. It's also running on multiple platforms. Enter the following command for install.
|brew cask install microsoft-azure-storage-explorer|
Once installed, you can see the screen like this:
Docker for Mac
Docker for Mac runs dockerised containers natively on Mac OS. Run the following command to install.
|brew cask install docker|
Once installed, you can run the Docker CLI straight away in the console.
If you've been using Virtual Box for Docker, it's time to switch.
Mac OS contains the git CLI out-of-the-box.
But, if you prefer to using GUI, there are many cross-platform tools for it. GitKraken is one of them. It offers a both free and paid version. In most cases, the free version would be sufficient. Run the following command to install GitKraken.
|brew cask install gitkraken|
Visual Studio for Mac
To install Visual Studio for Mac, run the following command with Homebrew.
|brew cask install visual-studio|
Once installed, open a solution and you'll be able to see code like that:
However, it's still lack of extensions and has a little mature eco system yet. Therefore, it's tough to catch up with the developer experience that I used to do on Windows. It takes more time to get enough extensions.
Visual Studio Code
Alternatively, we can use Visual Studio Code. It's built for cross-platform and has large extensions pool. Admittedly it can't fully replace Visual Studio, but with many extensions, it can keep up most things. Let's run the following command to install Visual Studio Code.
|brew cask install visual-studio-code|
In fact, VS Code itself is enough for .NET applications. But installing several extensions will give you much relief. Here is the list that I've installed and been using so far. I know the list is not perfect, and it's purely based on my personal experiences. It really has helped me a lot. I wouldn't touch further on each extension here, but add links for them.
- C# Sort Usings
- C# XML Comments
- Azure Tools
- Azure Logic App
- Git History
- Live Share
- Visual Studio IntelliCode
- Visual Studio Code Icons
- SVG Viewer
Once these tools are ready, we can create a .NET Core project by running the following commands.
|dotnet new sln --name MySolution|
|dotnet new classlib --name MyClassLib --language c#|
|dotnet sln add MyClassLib|
We've now got a new .NET Core project from dotnet CLI. Open the project with Visual Studio Code to put more codes.
Postman is still widely used for API development and testing. There are other useful tools as its alternatives. So, feel free to choose the right one for your purpose. The following command allows you to install Postman.
|brew cask install postman|
ngrok is a handy tool to test webhook APIs on the local machine.
|brew cask install ngrok|
In my previous post, I dealt with how to use
ngrok. It's nice to have a read the post.
The tools introducing below are not for .NET application development but for writing technical documentations.
Snag It helps for screenshots. If you think that the default feature on Mac OS is not enough, this will be useful. But make sure that this requires payment. If you are seeking for a free version, you better find out alternatives.
|brew cask install snagit|
|brew cask install camtasia|
Grammarly is particularly useful for developers who speak English as their second language. It picks up grammatical errors or suggests appropriate words by analysing sentences and contexts. If you are writing some technical documents, Grammarly really will be your best friend.
This supports most modern web browsers, including Microsoft Edge, Mozilla Firefox, and Google Chrome, by providing browser extensions. Alternatively, you can download and install the desktop application,
|brew cask install grammarly|
So far, I've discussed several tools running on Mac, to help or improve developer experiences. I hope this document will help myself and others in the future.