Atom – A hackable text editor for the 21st Century

Suppose we have two extremes when it comes to code editors. In one corner are the old school trusted veterans like Emacs and Vim, and in one corner are the feature packed IDEs like Visual Studio and Intellij IDEA. Somewhere between these extremes, we would find Sublime Text – an editor which has gotten a lot of traction in recent years. This middle ground is home for coders who don’t really require heavy IDEs and but might be afraid of the steep learning curve of Vim or Emacs. This gap between the extremes where Sublime Text roams is where Atom wants to be.

Atom is in many ways much like Sublime Text and there is no doubt that Atom is heavily influenced by the philosophy behind Sublime Text. The GUIs are very similar and if you visit Sublime Text’s website and try out all the shortcuts and features which are highlighted on the front page, there’s a good chance that they will work the same way in Atom. So the question is – why pick Atom over Sublime Text?

To give a little bit of background, Sublime Text may now be considered a proven editor which has been around since 2011. It has been stable for a long time and is often praised for its snappiness. Sublime Text is cross-platform with builds available for Windows, Mac and Linux and it features a Python API to interact with the core written in C++. One of the best features of Sublime Text is that there are a lot of very good third-party packages. However, installing and managing them is a bit of a hassle (if you haven’t installed the third party “Package Control” which I guess everyone has so in that case you only have to install one package manually).

Atom on the other hand is very new. It was introduced in 2014 and while it is cross-platform, there are no official builds for neither Windows nor Linux at this time. Despite Atom’s young age, there are three things which already makes it a very interesting competitor to Sublime Text.

First of all, Atom is open source under the MIT License while Sublime Text is proprietary. Free software does not equal free beer, as we’ve been told many times, but Atom is also free as in beer – Sublime Text packs a $70 price tag (which I don’t mind – you should pay for good software). But being open source, and free as in free speech, also means that while there are no official builds for Windows or Linux at this time, there are third-party precompiled versions available already.

The second interesting thing is that Atom is based on Chromium. This means that packages can be written in JavaScript or CoffeeScript using Node.js and familiar tools like jQuery and Underscore (supposedly C and C++ calls are also possible). This also means that you, at any time, can press the classical cmd + alt + i (or ctrl + shift + i) to access the developer tools like you would when developing in Chrome. By doing so, you can inspect the code while it’s running and easily interact with the editor in the same way you would while developing any other web app.

But the most interesting thing about Atom is how the GitHub ecosystem ties it all together. GitHub Inc. is the company behind Atom and it is very clear that the code you’re working on in Atom should reside inside a Git(Hub) repository – and this is probably why Atom itself is free. While GitHub itself isn’t anything special, don’t get me wrong with this understatement, but what really sets GitHub apart from say Bitbucket is the community around it. People pay GitHub for private repositories, while they could’ve gotten them for free from Bitbucket, simply because everyone else is using Github. It is where the action is.

As with GitHub, the community around Atom is really where it shines. There are a lot of community-written packages considering how young Atom really is – probably thanks to the web like API. I’ve found replacements for all my favourite Sublime Text plugins but Atom takes the package eco-system one step further. For starters, Atom ships with a built in package manager called apm which is basically built around npm. All packages are tied to GitHub repositories so you can easily check out the source, report bugs and do all the other GitHub-related activities you’re used to. Now to be fair, Sublime Text can in theory do these things as well, if the developers choose to use GitHub which most of them do, but in my opinion Atom makes everything a bit easier out of the box by utilising the built in package manager which in turn “enforces” a GitHub lock-in.

The really cool thing all of this enables is that you can open up and inspect the source of the running packages directly inside Atom, change the code, “refresh” the editor and have your changes working directly, like a web app – and if your changes aren’t working, just fire up the developer tools and inspect what goes wrong directly inside the editor. And once again, since everything is centered around GitHub, you can easily submit a pull request with your changes for everyones benefit.

The real eye-opener for me, who is used to web development, was when I started using a plugin for detecting potential errors in my code. The plugin reported that there was a potential error on line X and character Y, and I thought to myself: “wouldn’t it be great to be able to click on this error message and have the cursor moved to the correct position?”. So I opened up the package inside my editor, found the code which printed out the line with the error message and just wrapped the line in a hyperlink pointing to the correct position in the editor. It was a one line change and hitting “refresh” and seeing it work immediately was simply a great experience.

After all this praise, I have to admit that it isn’t all good in the world of Atom – at least not yet. There has been a lot of reports of the editor being slow, especially on Retina MacBook Pros. I have found this to be true sometimes but most of the time it has been working really well. The performance has sometimes gotten worse the longer I’ve kept Atom open but most of the problems was simply because of some poorly written package. But in the end, however you see it, Sublime Text is a much more mature editor and it is hands down faster than Atom. However, I have no doubt that this difference will decrease over time as Atom grows up and becomes more mature. In fact, Atom is currently working on an improved editor component to address the performance issues and you can enable it right now. See the post Moving Atom to React on Atom’s official blog for more details about this.

As a final conclusion: give Atom a try if you want an open-source Sublime Text-like editor with an awesome package eco-system and preferably likes to tinker with JavaScript or CoffeeScript.

This Post Has 3 Comments

  1. vijay

    Wonderful post about atom text editor. i move from notepad++ text editor to atom hackable text editor.

Leave a Reply