Being a former Windows and .NET Framework developer switching over to .NET Core and MacOS
Audience for this post
This post is mainly for people that like MacOS, for whatever reason. Even if you hate MacOS and love Windows - then sure, you can absolutely still read it, to know how "MacOS" people thinks (which can be useful for other reasons, as in understanding your potential colleagues better). If you're already absolutely confident that you can be a .NET Core developer on MacOS this post might not benefit you that much either. But if you're curious, read on. At the core, I want this post to be rather simple and explain how I can be using MacOS in my daily job. So it's more than just "get up and running", doing a hello world. This is my current toolset (for working with .NET Core, IDE's, Editors, Console, Azure, Microservices, Event-driven architeture etc.)
I remember a few years ago when I started off as a .NET (Framework) developer. I moved to Stockholm to work, used Windows as my primary OS, life was good. At that time I didn't really have much of a choice. Windows was the world if you wanted to do .NET/C#, and I had to stick with it.
But hey, time is changing, and so is the .NET platform. Since a few years ago, more precisely 2016-06-27 when Microsoft released .NET Core 1.0, things are starting to change rapidly. Not over a day, but you know, a few years later now when .NET Core 3.1 is pretty mature (not in terms of years in production but in terms of "a-lot-developers-world-wide-seriously-create-all-new-API's-and-backends-in-.NET Core") it's really time to consider what OS you actually prefer. For me personally, i've always liked the way MacOS works. Looks very neat and feels incredible robust (well, compared to Windows at least). I also think the terminal in MacOS is way better than Windows terminals like PowerShell and cmd. That was enough for me to make my next laptop purchase a MacBook Pro 2019 with the maxed out i9 processor with 32GB ram.
However there are some obvious cases where MacOS might simply not be an option, so let's see what they are:
I want to make it clear to you that if your work requires heavy use of something "very-windows-dependent", like SQL Server - or old MSMQ - you might have a harder time to completely switch over to MacOS for obvious reasons. There's simply no good tools for it yet for MacOS (or Linux for that matter). And on the other hand - the switch might be easier if you use tools like Azure, ElasticSearch, Redis etc that either requires heavy use of just a web browser as the primary client to interact with, or cross-platform CLI tools, or anything that runs just fine in docker.
But given that you're okey with the above, and still want to try MacOS, let's go:
Beware that some parts of this post is very opinionated. Not in the way that "you must use these tools!" but rather in a way that "this have seriously worked very well for me, and might also for you".
C: vs /
It's very hard as a developer to do any useful work without understanding the file system reasonably well. In Windows, you do
cd c:\ and on MacOS you do
cd /. So the root of your hard drive is therefore simply
/. Wondering where your users folder is stored?
cd /Users/jim/... is the place. Wondering what
/Users/jim/pictures/code.png is? It would be equivalent of
c:\Users\Jim\pictures\code.png on Windows.
In Windows you open the Explorer program to browse your file system. And on MacOS you use Finder. I remember when I started to use MacOS. I couldn't understand Finder at all. Everything seemed so strange. I couldn't even go to the freaking hard drive and browse files. So therefore i'll give you a few tips here.
- Open Finder. Now you don't even see your hard drive.
- Go to the top left corner and select "Preferences..."
- Select at least "Hard disks". Now you can see the hard disks in the sidebar in Finder. Now you might feel a bit less "lost" compared to Windows.
- Navigation in Finder is mostly the same as in Explorer on Windows.
In Windows executables have the .exe extensions, but in MacOS they don't. MacOS don't require extensions actually. This is why you'll see questions and answer on StackOverflow that mentions
/usr/bin/bash. It just means run the program called bash. And
/Applications/SublimeText would mean run the program SublimeText. No
.exeor anything here.
Once you really understand why everyone on StackOverflow post scripts and one-liners that starts with the odd slash (
/) , now you know why. And one more thing -
~ is the shortcut for "your home directory". So instead of writing
/Users/jim/code you can write
~/code. This is fantastic and simple. And now you also know what it means when you for the first time open up and terminal and the prompt says
~. It means you're currently in the users directory.
I think PowerShell on Windows and the Terminal on MacOS works pretty much the same on a high level. To change folders you type
cd <foldername> on both, and list content can be done with
ls. To navigate one step up in the Terminal you do
cd.. on Windows and
cd .. on MacOS (notice the space there).
I suggest you install and try a tool like ohmyzsh, they have decent themes and other cool stuff such as autocomplete that allows you to press tab while typing.
Along the lines of Terminal, have a look at the homebrew project, which allows you to install tools from the Terminal. Very neat if you ask me. This tool is amazing and Windows is really lacking an appealing equivalent.
brew install <name> is at your service. A rule of thump is that
brew install <name> is used for non-GUI tools (be that nodejs, git, mitmproxy or any other tool). And as a rule of thump
brew cask install <name> is used for GUI applications (such as SublimeText which you'll see below). Read "what is brew cask?" if you're curious.
Not much to say, if you're using Git just go and install it. It'll work the same as on Windows if you prefer the Terminal. If you like GUI tools I can highly recommend Gitkraken. It works very nice and looks clean. Gitkraken works and both MacOS and Windows and supports most commands you'll ever use such as; push, pop, merge, branch, stash, rebase, squash and more.
.NET Core SDK
Install the latest .NET Core SDK. Gives you the dotnet CLI tool that allows you to do
dotnet run etc from the Terminal (same as in Windows). Install this and you're good to start building .NET Core apps.
Today I think it's very hard to live by the day without having NodeJS installed. There's always some kind of dependency on it whatever you're developing. At least that's how it has been for me. However - usually it will make your life much easier if you install NVM instead of NodeJS directly through brew. NVM will help you easily switch between versions of NodeJS with a single command. So go ahead and
brew install nvm and then
nvm install XXX to install your version of choice of NodeJS. Install more versions of NodeJS with another
nvm install XXX and then easily switch between them with
nvm use XXX.
Also, personally I don't have any experience with it yet, but read up on NPX too if you want. It's sort of like NPM, but slightly different. Here's a article on NPM vs NPX.
Visual Studio Code (VS Code)
Awesome and extremely popular editor. I guess it's unfair to say it's a must-have, but what I can say with confidence is that if you haven't tried it you might very well be missing something out! Free and cross-platform. Many colleagues to me use this extensively for frontend development (even some backend). Personally I use it for an overview of plenty of repos, frontend development, terraform stuff and more. Download here or install with
brew cask install visual-studio-code.
A text editor is a must-have for any developer. I think nowadays more and more people are using VSCode as their editor, since it's so lightweight. Personally I like to have more of pure editor, for simple copy and paste. SublimeText has worked well for me - it supports tabs (must have) and even a folder browser. Install with
brew cask install sublime-text2.
Visual Studio has for many many years been the go-to IDE for any .NET or C# development. But no more.
JetBrains is well-known in the C# community for the awesome extension ReSharper have built their own IDE called JetBrains Rider that runs on many platforms and does a great job at integrating ReSharper natively into the IDE and support .NET debugging. I've used it for over 1,5 years and love it. Works like a charm on MacOS. Cost at the time of this writing is 270 EUR for a year, which I think is a reasonable price. Not too much or expensive. I'd recommend to install this via their site.
Just for reference: Indeed Visual Studio for Mac is out there, but when I tried it it lacked so much functionality that I considered it useless. Might be better in the future and a candidate to Rider.
Not a lot to mention to be honest. If you need it and use it you'll download it!
brew cask install slack
Not using these tools a lot (I prefer the web based clients), but coming from the Microsoft and .NET ecosystem it's not unusual that your company depends on this suite of tools. It's good to know that they exists and works very well on MacOS. Outlook, excel, powerpoint etc.
If you're using Azure you might have come a crossed the Azure CLI. It's a great tool to manage Azure resources from the command line.
brew install azure-cli. Works cross-platform.
Useful for some random sharing of information across devices I think. Works very very across mobile/Mac/PC. Put stuff like png's or .docx on your Mac and browse them on another Windows PC if you like. 2GB free. Download here.
One of my favorite tools. I don't think I can live without this tool anymore. Makes me sleep well, knowing my passwords are different for every single service i'm registered for. Does cost money, but worth every penny. 1Password first came into my world by a recommendation from Troy Hunt at a conference. 1Password have an amazing app for at least iPhone as well. Native app on MacOS works good and there's a Chrome extension too called 1Password X that works very neat.
Tool for handling 2FA. Syncs across devices which is awesome if you happen to reformat your device or something like that, so you don't have to setup all 2FA accounts again. Take a look at their site. But actually, if you already have 1Password, you can use that for 2FA too!
We use docker extensively in my team. Since we use Linux containers behind the scenes, it works well to collaborate with my colleagues using Windows as their OS of choice. Download and install from here. Free and cross-platform. Commands are the same everywhere.
Azure Storage Explorer
Tool to help you browse storage accounts for example in Azure. Absolutely no need if you don't use Azure regularly. And on the other hand, it's free! So try it out. Azure Storage Explorer.
This post was primarily for .NET people that are used to Windows and want to switch to MacOS. I wanted to give a sense of feeling that it's very doable today, and it'll only get better. As systems built on .NET Framework will decrease over time, and .NET Core will take more space, there dependency on Windows will presumably decrease too. You'll most likely be able to get an awesome job with your MacBook coding C#. Personally I'm very happy to be using my MacBook Pro for coding and MacOS as operating system, and I hope you've got some inspiration too and try it out if that's what you want.
Update 1 (2020-02-22):
On Windows you can press the windows key + arrow key to move a window and make it take the full screen space. This is however not possible on MacOS by default, and BetterSnapTool is a little tool for just this. Very much recommended. Costs 3$ from Apple App Store but worth every penny if you ask me.
Not sure how I could forget this when I wrote this post. Alfred replaces the default Spotlight Search. So you can easily search through most applications on your Mac. I actually bought Alfred Powerpack just to get the Clipboard History feature. This feature lets you copy multiple things and then instead of just the standard command + v to paste, your press your <shortcut of choice> to get a list of recently copied items. The powerpack costs €25 (and gives you more features than just the Clipboard History, of course).
Damn beautiful simple tool to keep your screen awake for some time, like 30 minutes or some hours. Awesome for presentations on meeting where you'd like your screen to not turn off and cause disconnects with external monitors etc. Free to download from the App Store to your Mac.
Useful links (mentioned earlier):