The Openness of macOS
There is a perception that Mac’s are closed down blackboxes, where you have no access to how they work or can configure them in anyway. But is that true?
The Mac has a huge fan base but also a huge group of ardent detractors who like to paint the Mac as a completely locked down system or some kind of toy. Something for less sophisticated users.
I have met many Windows users who have this perception that due to its ease of use, it is somehow a less capable or flexible system. That somehow it lacks advance features, configurability, use of hotkeys etc.
This story is an attempt to try to dispel some of this myths, by giving you some more insights into what the macOS is capable of and what is under the hood.
MacOS is a real Unix Operating System
Many people are not aware that macOS is actually a certified Unix operating system. Ironically Linux is not a certified Unix system. MacOS is closely related to BSD Unix. If you go to your terminal application it is easy to see the familiar Unix directory structure:
MacOS Has a Clear Tinker Friendly Structure
Navigating a normal Unix system is not always easy, and I would argue that Windows is especially a a complex system with a lot of oddities. I cannot speak about current Windows 10, as it has been a long time since I was an active Windows user, but traditionally MS Windows did not have a clear structure for where things where placed.
What is most noticeable when digging behind the surface of macOS is how the same patterns are repeated over and over again making it easier to explore the system.
Directory Structure Patterns
When using the graphical file manager Finder you don’t see the typical Unix directories but you see this:
This is a remarkably clean and easy to understand structure.
- Applications is a folder that contains all the applications you have installed.
- Library contains all sorts of frameworks, libraries, extensions, resources and plugins installed by third parties. The core OS is not in here.
- System contains everything related to the operating system itself.
- Users has a subdirectory for every user of the system.
So here is the neat thing. If your system is filled up with junk, you could in principle just toss the whole Library directory because it only contains third-party stuff. You would not touch your operating system.
Library represents a pattern replicated multiple times. You got library in the following locations:
The latter is your home directory.
Easy to Find Config Files Instead of Registry
If Windows Registry was a good idea I don’t think there would have been so many articles online about how to fix it and deal with it. Basically in Windows all application setting is accessed through a centralized database, which has all the fragility of a single point of failure system.
MacOS in contrast has a much simpler solution which is easier to tinker with and troubleshoot. We got the
Application Support folder on two levels:
Underneath each of these folders there is a folder for every application with the configuration and settings for that application. Under
/Library/Application Support you got system wide setting, while under
$HOME/Library/Application Support you got setting specific to a particular user.
Here you see some of the contents of the
Application Support in my home directory. If I want to find a setting stored for a particular application I can look here:
Say I play a game, then the saved games will be located in the directory with the same name as the game I am playing. For something like an Integrated Development Environment or Coding Editor you will find plugins, snippets and other things stored right here. For instance I used the TextMate editor. Here you can see some of the plugins I have installed, under this directory:
So if an application is acting out and is broken in some way. A quick way to fix it, would simply be to go to your
Application Support directory and simply delete the directory holding the configurations for that application. This is completely harmless as only user specific configurations are stored here. You are not removing some crucial configuration files that the application absolutely needs to function. Those are not stored here.
Remember, I said MacOS is tinker friendly. It keeps important stuff separate, so you are less likely to screw up things. You have a much better sense of what you added and what the system added, as well as what must be present, and what simply is convenient to keep around.
The Genius of Bundles
One of my absolute favorite things about MacOS is bundles. It is such a ridiculously simple but at the same time really powerful idea.
Windows users know how you give a type to a file by adding an extension such as
.mp3. Well macOS takes that one step further and lets you do that with directories. Thus the "files" you see above with the
.tmbundle extension are not actually files but directories. MacOS simply treats directories with an extension as one logical unit at the GUI level. If you use the command line it does not look like that.
The most obvious example of where this is used is with macOS applications. They seem like just a file with a colorful icon which you can double click to launch. However macOS applications are directories with the
The reason why this is such a brilliant solution, is because it solves a lot of problems:
- Installing and removing applications are simple drag operations. If somebody sends you an application, it will just be a zipped application bundle. Just uncompress and drag into Application directory or anywhere you want. Tired of it? Just drag and drop it to the trash.
- Tinker friendly. If you want to figure out more about an application, tweak it or understand better how it works, then then you can simply open the directory.
Here is an example of showing the directory contents of an application called The Unarchiver. You right-click and select Show Package Contents which will show the files and directories inside to the right.
The inside of an application bundle follows a standardized organization. The operating system knows exactly where to find key resources and information. For instance the application has an icon shown in the file manager. Where does this icon come from?
Every app works the same way? What about the executable which is run when you click the application icon in the file manager? That is located at:
The Unarchiver.app/Contents/MacOS/The Unarchiver
Now you may wonder how the OS knows the location of the icon file as it is not named the same as the application? Every app bundle has a
Info.plist file, which is basically an XML file which looks something like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
This file gives a lot of information about what kind of application it is, what it can do, current version etc. It also lists e.g. what types of files it can open. Also if you search through this file, you will find an entry looking like this:
This gives the name of the icon file. Because this XML file uses tags in a very regularized fashion we can use special GUI editor to open and edit the file. We don’t need to use a text editor.
This is a far more accessible system than the Windows registry. You can easily locate these configuration files since they are inside every application. You can clearly separate this configuration information from user configurations which are located in
Application Support. Generally you should not tinker with this configuration files. But they give you a nice way of peeking and poking at applications to understand more about them. It gives you the kind of openness that I find lacking in Windows. These are files you can easily search through with a text editor. You could copy the file and put somewhere else to fiddle with it. You can use standard tool to work with it. You are not limited to some specialized tool like the registry.
The reason the registry exist is of course for performance reasons. The OS centralized information and store in a binary format so it can quickly be retrieved.
The macOS solution is IMHO far more elegant. It does have something akin to a registry, meaning a centralized database which holds things such as application icons for fast retrieval. But this is just a cache of what is stored inside the application bundles. You never edit this database yourself. The only editing you ever do is on plain text files, which keep things simple.
Resources are Easily Inspectable
Unlike Windows resources are not compiled into the executable. And unlike Linux they are not tucked away on the other side of the filesystem deep in some nested structure. No, everything is bundled together neatly and exist as separate files.
Things like toolbar icons you see in an application are just regular image file in the
Resource folder. Things like the text you see in the user interface is stored in plain text files. See a spelling mistake in the GUI? You could actually go in and fix that.
Or maybe you lack a translation to your language, or the one that is there is crappy? You could actually add a translation yourself. It is just resource files in plain text.
Even the graphical user interface itself is typically stored as separate resource files with the
.nib extension. Sadly you cannot easily edit these the way you could in the past. You can open them as XML files and edit stuff in them. However in the past you could open them in a GUI designer directly and actually start rearranging the GUI of built in applications!
And you say macOS isn’t configurable enough!? I remember in the past having added my own buttons to standard Mail.app application without having any access to the source code. That kind of manipulation is way harder in Linux or Windows where that kind of information tends to be compiled in or hardcoded in some way.
Almost anything important in macOS you can configure through the GUI has some corresponding terminal command. With a full blown Unix system at the bottom that is really powerful.
Further GUI applications can be automated in a variety of ways. A number of applications can be automated with Apple Script e.g. If you don’t know what is possible, you ask Apple Script to open an application dictionary. It will then let you browse your installed applications. When you select one you get a GUI showing you an overview of the actions you can perform:
The one above is for the macOS file manager called Finder. AppleScript as a language looks really odd and not what you are used to from other languages. It helps to think about it are more like SQL (standard query language). Like SQL there isa syntax for specifying what object or objects to select.
However the key difference from SQL, is that it is bundled with actions. So AppleScript is used to specify how to query or pick object but also what actions to perform on objects that match query. It is not like a regular language where you obtain an reference or pointer to an actual object which you can then perform actions on. Rather the automaton system has to submit a query along with actions to the application itself. The application then interprets the query and applies the actions specified to the objects matching the query.
While the syntax is oddball, it helps that you can actually record apple script actions. The code you see here was create by clicking the red record button and performing file manager operations.
For a more user-friendly approach to automation you can use the Automator application. It basically offers a visual programming language for combining actions from different applications. You can have one application produce results which are piped into the next application in the workflow.
The example above show batch renaming of files you have selected in Finder.
MacOS is very Keyboard Friendly
One of the most persistent myths about macOS is that is is not keyboard friendly. Frankly I think it is the most keyboard friendly OS. But it depends on what you value of course. A very important choice in macOS not done on Windows and Linux is that GUI short cuts such and copy and paste are with Command-C and Command-V keys, rather than the more common Control-C and Control-V. Why is that important?
Because standard Unix and DOS terminals use Control for all sorts of operations. To interrupt a program which is executing you use Control-C. To put a program in the background you use Control-Z.
Thus with the macOS solution, there is no collision with these important usages of the hotkeys. You can copy and paste text to and from a Terminal window easily. And for someone who get accustomed to the hotkeys used in a terminal, you can use hotkeys such as Ctrl-A and Ctrl-E in any Mac application because the use of Ctrl doesn’t crash with the Command key usage.
Standardization of Common Operations
On the Mac, quite a lot of common operations have standardized conventions you can use in almost any application:
- Command-N — Make a new item of something.
- Command-I — Get information or properties of a selected item. Will work in file manager, drawing applications etc.
- Command-D — Duplicate an object. You can often use this to e.g. duplicate a shape in a drawing application. Duplicate a file the file manager or any other place.
- Command-, — Open preferences for current application.
- Command-W — Close current window.
Ok, I am not going to go through the whole list, you get the point.
Performing Any Menu Entry in a GUI Application
On Windows and Linux you can use Alt together with various underlined single letters to perform a particular menu entry. Windows users tend to complain about this missing from Mac but often unaware that there is a much better system available:
This give you a search function for menu entries. You can just start typing and get immediate matches. One or two keys is often enough to get you desired match. You can use arrow keys as well. A benefit of this is that it lets you invoke desire command but it also shows you where the menu entry is located for future references.
If that is not your cup of tea, there is yet another option. Hit Control-F2 and you can use arrow keys to select top menu entry or simply begin typing a match. One you hit a submenu you can can just start typing what you want to match. Again one or two keys is usually enough. Or use arrows.
Still not satisfied? Want a hotkey that requires no navigation? Turns out Apple can fix that for you as well.
Above have gone to
System Preferences → Keyboard → Shortcuts → App Shorcuts and added a shortcut for iA Writer, which I am using to write this very text. The beauty of adding this ability at the OS level is that macOS allows you to add a shortcut for a particular type of functionality for every application on your system. Hence you don't need to configure the same shortcut for every possible application repeatedly.
Now I am sure there are people who still moan that macOS isn’t keyboard friendly because that has sort of become a mantra and truthism. Reality is that most of these people have simply not bothered to learn the macOS way of doing it. They assume it is going to work the same as on Windows and Linux.
Before complaining about macOS being different, it is also worth keeping in mind that macOS standardized these things long before there where any Linux or Windows applications. For one reason or another Microsoft decided to use different convention from Apple. And Linux… well they simply copied the conventions of the most dominant desktop OS at the time.
The Perception of Lack of Flexibility
A lot of the reason why macOS comes across as not being as configurable, flexible or capable has a lot to do with Apple’s superior GUI design. They simply pull off making complex things look simple. When something looks simple, often also looks less feature rich or less capable.
To understand how Apple is able to keep the same amount of functionality as their competitors while offering a radically simpler UI, I advice you to read this story: The No Bullshit Guide to Icon Design and Usage.
A common Apple strategy is also to make the most geeky stuff primarily accessible through the command line. For things a normal user doesn’t have to use they also tend to hide it in a way where you need to hold down Shift or Option key to display that user interface element. That is to avoid that normal users select UI options best reserved for power users.
I agree that is not the most discoverable thing. But long term Mac users are very aware of this convention. It is not something you need to use often, and normally it is stuff power users would do on the command line anyway.
I use Windows so seldom today and for those of you who use Windows I don’t interact frequently enough with you to know the issues you may have with macOS, or Linux users for that matter. Hopefully I have covered most aspects. Learning a new OS and its idiosyncrasies always takes some time.
Naturally some things are more configurable on Linux in particular as it was an OS made for computer geeks and it does not have a standardized GUI. That allows more tweaking and configuration of its appearance.