When comparing GNU/Linux vs macOS, the Slant community recommends GNU/Linux for most people. In the question“What is the best operating system for a developer?” GNU/Linux is ranked 1st while macOS is ranked 2nd.
Ranked in these QuestionsQuestion Ranking
Pro Access to really powerful terminals
Pro Lots of development tools available
Pro Most likely also your deployment target
Makes testing while developing easier. According to a September 2014 study by W3 Techs, *nix based servers are used on over 2/3 of websites.
Pro Most software is open source
Pro Package managers
You can install any library or package that you need (gcc, php, node) with just a couple of commands in the terminal.
Pro Large percentage of Linux users are developers
Pro Most Linux distributions are free
Pro A wide variety of distributions available
With a lot of variety, one can use the distribution that fits the type of work best because of the many choices that are given, instead of just one.
Pro Follows the UNIX philosophy
The UNIX philosophy: 'Write programs that do one thing and do it well'. Since Linux itself follows this philosophy then it's very easy to start creating scripts and programs.
Pro Familiarity with Linux is often required from a developer
Many university computer science programs are based on Linux and in any case, you will inevitably be dealing with a Linux box of one flavor or another someday, be it a server (most likely) or a workstation. The languages and methods used in the Linux/Unix environment (e.g., bash, C, C++, Make, etc.) are very commonplace among developers and are to the computer side of the discipline what the English language is to the human side of it: the common language.
Nice, developer-friendly environment.
GNU/Linux handles desktop sessions differently than Windows. Users may customize their own sessions; in fact, a single user may use different desktop environments for different login sessions.
Pro Choose any type of desktop environment (or none)
Most Linux distributions support a range of desktop environments, be it plain old X, a tiling window manager or a fully fledged mammoth desktop like GNOME or KDE.
Pro Works great on older hardware
7-10-year-old Dell laptops can run Unix or Unix-like OSes very well, where Windows would grind/drag/vomit.
Pro Hardly ever crashes
Pro No telemetry, unlike Windows
Pro Lower chance of data loss
Linux has very few viruses. So there's almost no chance of getting infected by a virus and thus losing your data including your important programming files.
Pro Extremely fast
Can be made even faster by going GUI-free or using a lightweight window manager.
Pro Just works
Linux tends to just work with little to no effort or troubleshooting required.
Pro Polished UI
The UI of Mac OS is rather unrivaled. The smooth, responsive, and cohesive UI makes the system quite joyous to use.
Pro Based on Unix
macOS being a UNIX certified system means that you can install a lot more stuff with a lot fewer headaches than if you were on Windows.
Pro Powerful terminal
It's very similar to a Linux terminal.
Pro Easy access to lots of great dev tools
There's a large selection of great development tools available for OSX. The operating system itself comes bundled with a powerful terminal emulator, called Terminal. Additionally, Apple provides tools, like Xcode, an IDE that contains a comprehensive collection of tools for developing OSX and iOS software, for free.
Pro Best support for Objective-C
Pro Ideal setup, out of the box
Next to no custom configuration is necessary.
Pro Lots of open-source software available
Because it's Unix under the fancy GUI, most open source ports easily to it.
Pro Has many special tools for developers
Has support for multiple IDEs
Pro More commercial software and gaming support compared to other Unix systems
Adobe CC, MS Office, Steam games.
Pro Great Git GUI tools
Tower, Kaleidoscope, SourceTree
Pro Great modifier key layout
Pro Has software that only runs on Mac
For example, Sketch.
Pro Streamlined workflow between devices
Because this is an Apple product, there is a streamlined workflow between your computer and all mobile devices. For example, if you type an a Pages document, once you save, you can open the updated document just moments later on your iPad, and vice versa. The same goes for iMessage, (yes, you can text people with your phone number from your computer. Actually, you can text other people with apple devices with just your Apple ID, with or without a phone number, for free!) Numbers, Notes, Reminders, Contacts, and just about any other Apple workflow application.
Pro Using VMware you can also run Windows 10 on the Mac
This is useful for testing and some development tools that are Windows-only (XML Spy, MapForce).
Pro You need it to compile macOS or iOS apps
Con Issues with drivers if your hardware is not officially supported
Con Maintenance can be time-consuming
Con Steep learning curve
Con Too much customization
To get features on par with OS X, you need to research packages, install them and configure them. Even then, it may not be as good as OS X.
Con A wide variety of distributions available
With a lot of variety, one cannot deploy to a single system and has to prepare for a bundle of distributions, instead of just one.
Con Less and worse professional software is developed, due to the low user base
Depending on what type of work you are doing, you may find Linux software lacking compared to their Win/Mac counterparts.
For example in game development, tools, like Unreal Engine or Unity, usually lack in quality or novelty compared with Windows. Having crashes or bugs that aren't fixed for a while.
Con Low user base to develop to
OSX is tied Apple hardware and Apple hardware tends to be expensive.
Con Limited hardware
Usually, the hardware that can run this can't be upgraded.
Con Most software is closed source
For people who like to use open source tools for their development work, this may be a problem. There's plenty of advantages to open source software, one of which is the ability to tinker with and customize the tools themselves that you are using. Although there's plenty of FOSS tools available for Mac, especially through Homebrew, the number of packages available is much lower than the number of packages available for any Linux distribution.
Con No native package management
A comparison of package managers available for OSX can be found here.
Con Very few options for running hosted, on the cloud
Con Bash version is obsolete
macOS comes with an obsolete version of Bash, due to licensing issues.
Con Closed source
Mac OS is closed source itself, which means that it is developed more slowly and has more problems
Con Silly modifier keys layout
The Command key is strange, Alt is where Super should be.
Con Poor application support
Fewer apps run on Mac OS than on Windows or Linux