πŸ”¨ Xcode Reimagined with Emojis

πŸ˜πŸš€πŸ€“πŸ’©πŸ•΅πŸ™ŠπŸ˜ŽπŸ˜πŸ

Aviel Gross
4 min readSep 16, 2016

Ever since Mountain Lion Apple added full support for emojis in terminal.

Nobody cared.

When Swift came out it had a full native support for emojis anywhere (inc’ type names, function names etc.).

3 people cared.

Apple file system fully supports emojis for file/folder names since Lion (or was it Mavericks?).

Maybe 10 people care.

But we should care! Emojis are probably the easiest symbols to spot in a blob of characters, and we can use them to sort, tag, identify and spot everything in our project lightning fast!

First is the project structure. The more our project evolves we start to have tons of folders/groups in the project navigator and pretty quickly it starts to get very difficult to tell what’s where. Adding emojis to the group’s names pretty much solves this issue. The best way I’ve found to name groups is with the β€œmo-name” template, where the name starts with a representing emoji, then a space followed by the actual name.

Emoji-driven project structure

Note that the emoji itself can either be a logically objective representation of that group, or a completely subjective emotionally motivated pick (after all, most emojis are pretty extreme emotional representations…). This way all the names are still perfectly aligned with the project navigator hierarchy, and those who are still not used to emoji-driven-navigation can just ignore them and comfortably read the plain boring names for ten minutes until they find their file.

The second place we should fill up with emojis is our log. The log is a bunch of endless text where we sometimes spend almost a full minute just trying to find the place in it that has the JSON response print we are looking for…

We can divide the emoji printing into two main types β€” constant ones and dynamic ones.

Constant emojis are those that repeat themselves for a certain kind of log. For example, we can have a global function that prints the current function with a special 🚩 emoji so we can spot such a print from miles away:

func printFunc(val: Any = #function) {
print("🚩 \(val)")
}

Another use can be a certain emoji that represents an error log, and can be also be printed through a special global function:

func logError(val: Any,
filename: StaticString = #file,
line: UInt = #line,
funcname: StaticString = #function) {
logError("❗️\(funcname)(..) πŸ‘‰ \(val) [\(filename.className()):\(line)]")
}

Dynamic emojis can represent specific events that happen or kind of data. For example, a single server request & response can be logged like this:

πŸ“‘ POST https://my.server.com/api/v1/Login
πŸ“¦ ["billingType": 1, "user": "mickJagg1", "ISOCode": "il"]
πŸ‰ Data received: 3.4kb
βœ… Login ➑ 🌐 200 | ⏱ 2159 ms πŸŒβ—οΈ

Here we have the emoji in the first line representing a new request sent to the server. The emoji tells us what happened, so we can make the log extremely concise, showing only the request info itself, without any extra explanatory text.

Next, we print the params sent in the request body (represented by πŸ“¦-package emoji).

When we get our response, we can see it’s size (if we feel that not every other developer would immediately recognize the watermelon as β€œamount of data” we can add the small label to detail it; although it’s pretty clear that this is what the watermelon emoji represents…).

The last line shows some emojis that are also part of the information on their own: the green checkmark tells us that the request went well, then we have our response code, and request time in ms. When the request takes over a certain delta to return, we add the πŸŒβ—οΈ emojis to warn that the request was probably too slow to process.

We can do so much more like printing headers (πŸ’‚), token (πŸ”‘) or the entire response data (πŸ“¬), and this is only for our APIs! The ⛅️ is the limit!

Here is an example from one of my projects for launching an app:

2016/08/14 09:02:17:346  πŸš€ APP LAUNCH: 14/08/2016, 9:02 AM
2016/08/14 09:02:17:418 πŸƒπŸ» Running on DEBUG mode
2016/08/14 09:02:17:419 βœ–οΈ Not using Analytics SDK
2016/08/14 09:02:17:428 πŸšͺ Validation: FRESH (showing login)
2016/08/14 09:02:17:477 🚩 registerVoipNotifications() [AppDelegate]
2016/08/14 09:02:17:479 πŸŒ€ First use: setting defaults
2016/08/14 09:02:18:103 🚩 pushRegistry(_:didUpdatePushCredentials:forType:) [AppDelegate]
2016/08/14 09:02:18:107 πŸ”‘ Did Update VoIP Push Credentials [AppDelegate]

See how easy and nice it is to try to understand what is happening here? Try comparing it to any other standard log that would print similar data…

Type β€˜em

It is true that typing an emoji is not as easy as typing ASCII (although this thing exists…), but macOS makes it pretty easy to get your emoji:

Press CMD+Ctrl+Space to open the emoji popup, than just start typing to search for the emoji you are looking for. Single-click an emoji to type it. You can use the same approach for any special character; type β€œsubs” for example for all the subscript characters available.

Pro Tip πŸ’ͺ

If you are using Wunderlist, you can begin your list title with an emoji and that emoji will become the icon for that list!

Fancy Wunderlist lists with emojis!

--

--