· engineering · 3 min read
Opinion: Emojis don't belong in code
Emojis are a fun way to express ourselves online, but they don't belong in code. Or why your rocket ship should steer clear of my IDE.
Table of Contents
Emojis are a pretty handy way of expressing any number of meanings without having to resort to using words, but increasingly I find them in code and this madness has to stop!
Code should be clean, concise, and meaningful. We agonize over variable naming and strive to avoid ambiguity, how on earth does ”🚀” help add meaning to our code?
👁️❤️💻🟰😊📖 (I love code that’s easy to read)
The IDE does such a fantastic job of highlighting the syntax; carefully chosen colors signify different aspects of the code, so that at a glance you can draw meaning from it. We don’t “read” code - we see it, we experience it, we debate the “best” themes for highlighting our language, and then someone shoves a red rocket blasting in to space in to the middle of a comment and disrupts that!
It isn’t just in code that they have no place, they don’t belong in commit messages either!
Emojis are inherently contemporary, their meanings are fluid, differing between localities, age groups, and cliques, they are frequently x-rated, and subject to change - in three years when someone looks at the hilarious commit message you wrote, you may inadvertently be saying something offensive, suggestive or simply meaningless.
Worse still, code passes through so many systems, version control, compilers or interpreters, servers, browsers, operating systems - there’s no guarantee that all of them will even support your emojis - on some it will fail gracefully, but in others it could introduce errors.
Ditch the emojis, and write clean, professional code
Use clear, and concise variable names, and if your code, or the person reading it will benefit from further explanation, write unambiguous, meaningful comments.
Keep your documentation up to date (I would argue against most emojis there too, though less passionately), and you won’t need the visual eye-candy - save it for social media and instant messages!
And in a similar vein, keep the slang out. Unbelievably I’ve seen errors “yeeted” before, and I’m fairly certain in five years that will make no sense to anyone.
One caveat
I concede that there are contexts where emojis are beneficial and can purvey important information quickly, for example in aws slack notifications.
A warning triangle emoji in a Slack message can quickly grab attention and signal a potential issue, as can, a big red “X”, a fire emoji or a green tick.
Emojis can quickly visually communicate an error state or success.
Though, I would argue that these are typically implemented as pre-defined templates or configuration, not code, and thus not subject to this rant anyway!
Conclusion
By following these practices, you’ll write code that’s not only functional but also a joy for everyone to read and maintain. Code is a form of communication, keep it clear, concise, and (mostly) free of emoji ambiguity.
There’s a time and a place for everything, but next time your reach for an emoji, I hope you’ll stop and think whether it’s enhancing or distracting your communication.
Save the emojis for notification and socials, where they can truly shine!
About James Babington
A cloud architect and engineer with a wealth of experience across AWS, web development, and security, James enjoys writing about the technical challenges and solutions he's encountered, but most of all he loves it when a plan comes together and it all just works.
No comments yet. Be the first to comment!