How to choose the right text editor
Ahh text editors, the things we use to edit text. We usually think of editing text as a simple task, but for for the modern programmer, text editors are tools with which we create magic.
Programmers spend thousands of hours in their chosen text editor, so choosing that text editor should be a big decision. You’ll become grossly attached to the text editor you choose. All developers claim their text editor as the best so looking online for text editor recommendations will leave you with no clear answers. This mega sucks. Seeing through all the noise is hard. We can get sucked into the heated discussions and online battles, or we can look at it from another angle. Instead of looking at each text editor and comparing them, let’s take a step back and see what the the text editor is actually about.
The history of the text editor
Let's go back the the beginning. Let's go back to before today’s text editors that have an endless list of functions and features. It all began with paper and holes.
Yes, humble beginnings. Computer code in the 1940s and 1950s was literally punched into pieces of paper, in a holey fashion. They then fed this paper into a paper-hungry computer for it to do its work. The first set of computers were simple creations, no smarter than you or I. They only had enough processing power to perform basic calculations. Manually carving the sequence of calculations into pieces of paper and feeding them into the computers was a viable option. But it was only viable for so long.
As computers became hungrier for juicy algorithms, paper with holes would no longer satisfy them. They needed some form of language. So, some smart programmers threw their hole papers to the floor and came up with a way to feed words to their computers. The computer could now take in some human-y wordy code and convert it into computery ones and zeros.
With the new wordy programming language, programmers can now tell stupid computers what to do in a smart way. But programmers needed a place to write their new programming language, so they created the text editor.
The text editor was a new platform where programmers could come up with new and crazy creations. These programmers didn't need much from their text editors to get by. Have a look at the Teco editor (created in 1963):
They were basic, but they got the job done. As the time went on, and computers became more powerful, we developed more powerful programming languages. We updated text editors to accommodate these new and expanding languages.
Fast forward to modern times. More powerful computers and more powerful languages. The list of things a programmer needed out of a text editor has increased to almost an endless list. Let's break down what’s in a modern text editor.
The anatomy of a text editor
The primary purpose of a text editor is to edit text. Simple enough. But not so simple since we're dealing with unsimple code.
When you are writing code, regardless of the language, you want to want to have it displayed in an understandable way. To help with this, we use syntax highlighting. Code will be highlighted and sorted so that you can understand it a little bit easier. This is especially important since you’ll be working with different languages all the time and need a way to keep track of how they all work.
Now that your code looks pretty, and is understandable, we need a way to edit it. The text editor will need a bunch of keyboard commands so that code can be wrangled and put in place. Copying, cutting, pasting, duplicating, deleting and shifting are essentials. The less a programmer has to think about these actions the more natural they become. A programmer who masters these commands will get shit done.
Text editors come stocked with thousands of keyboard commands ready for a code magician to integrate into his keyboard-command quiver. Since your code will be bunched together in a project folder, the way you access these folders is important.
Enter the tree view. Built into your text editor, the tree view ensures all folders and files are accessible, and enterable. Switching and swapping between files is a constant and having an easy and intuitive way to do this is critical for a good workflow. A trusted companion to the tree view is the finder. When you want to access a file that you know the name of, or search for a specific line of code the finder is going to find it for you.
These are the most basic text editor features. A text editor that doesn’t do one of these well is a text editor to avoid. A programmer needs to work efficiently. Not being able to so something very basic can cause you huge amounts of stress. While programming you want your stress levels at their lowest so finding a text editor that keeps stress low is a must.
Now that the basic features are out of the way, let's have a look at some of the more advanced features.
We have code completion, which is basically code syntax on steroids. As you are writing in a programming language all possible options will pop up before you. This acts like training wheels and is a useful feature when you don’t know the language. But once you know it, the suggestions get in the way, so then it’s best to turn code completion off.
A similar feature is a linter. A linter will check through all your code for mistakes. Linters are awesome. Linters for different languages can be loaded into your text editor and be configured any way you want.
For the main text editors, you also have the ability to build more features into the text editor. If there’s something your editor can’t do, you can take action and make it do what you want. We call these additions plugins.
Programmers, being a demanding bunch, will create plugins for anything, no matter how big or small. Plugins build on the core features or create new features completely. There are syntax highlighters for whatever language you want, code minimaps, UI themes. You can even get a plugin for the latest selling price for Bitcoin. Someone has gone through and made a flash game in a text editor. Not all useful. But the options are endless.
Choosing your text editor
As mentioned earlier, programmers become super attached to their text editor. A great deal of pride and comfort is taken from a text editor - after all, you spend spending thousands of hours using it. Looking at text editor discussions online and you’ll find no clear answers.
But it’s important you make your own decision on this one. The process for me was to literally try every single one and then choose the one that worked best.