Interlude – Editors

No matter what language you use, be it intrepretted, compiled, or a markup language, you need one tool that every other coder uses — a good editor. Which editor you use is largely a matter of personal preference, driven by experience and ease of use for the task at hand.

There are several — well, dozens — I’ve used over the years, but there are just one or two I keep coming back to. One thing I’ve learned is this:

No matter what anyone else says, there is no one perfect universal editor.

What works for you is the right editor. Even if it’s vi.

The editors I keep using fall into roughly three categories — basic editors, IDE’s, and coding editors. Here’s what I use and why.

GNU nano

It comes with every Linux distro I’ve run so far. GNU nano is a simple, fast, command-line editor that does it’s job very well. However, it’s really only useful for basic text — I don’t use it for coding. On Windows, the closest alternative is Notepad on Windows, or while the Mac has the nominative deterministically named TextEdit.

The GNU nano editor, running in a Konsole window on Linux
The GNU nano editor

So what do I use it for? Config files only — there is a kernel module I use that needs to be updated whenever the kernel is. When that happens, I need to change a config file, and nano is the easiest to run as the superuser. In other words, sudo nano ... .

IntelliJ IDEA

IntelliJ IDEA from JetBrains is a Java-specific integrated development environment, or IDE. I use it exclusively for my Java work, and it’s what I use to teach Java. JetBrains makes several language specific IDE’s, including PyCharm for Python, and even RustRover for Rust.

IntelliJ IDEA when you first start it.
IntelliJ IDEA on first start-up.

The main advantage to IntelliJ IDEA is that it is 100% dedicated to Java and the Java ecosystem. Plus, if you code in more than one language, and stick with the IDE’s from one vendor, then they’ll all look and work alike as well. You don’t need to figure out if the Find command is CTL-F or CTL-S or something else.

Of course, having all these IDE’s installed can be a burden on your hard drive, and they can take a while to download and install. There are language neutral IDE’s, which provides the framework for editing, building, and deploying code in any language supported by the IDE. The best example of this is Eclipse, which supports tons of languages, including Java, C/C++, PHP, Python, and more. The extensible framework allows you to extend and expand your coding environment in a uniform way. The keystroke you use to find an identifier in your Python code will work for C and Java as well. However, like all IDE’s, they are big and can be expensive to purchase, support, and maintain.

If you have a Windows machine and prefer to pay lots of money, Visual Studio from Microsoft is available as well, with support for just about any language you can think of.

VSCode and VSCodium

For the record, I used to work for Microsoft. I started as a support engineer shortly after Windows 95 was released, then became a tester for Windows XP, and was a program manager when I left after 21+ years to become a teacher. I was there when the company hated and feared Linux and open source, and I left shortly after the company started loving and embracing Linux and open source (purely coincidence, I assure you). Anyone else remember "embrace and extend"? But that’s another blog post…

Part of the new love for open-source is the Visual Studio Code editor, or VSCode for short. VSCode runs on just about any platform you can think of — Windows, Mac, and whatever Linux distro you choose to run. It’s open source, which means you can look at the source and change what you want. In that respect, it’s a big deal for Microsoft.

VS Codium on first run, ready to go.
VS Codium ready to go out of the box.

Of course, being Microsoft, the editor "phones home" regularly to report telemetry and other usage stats to Microsoft. If that worries you, or you just don’t want to incur the network traffic, there is VS Codium, a fork which removes this feature for you.

There are two main reasons I like VS Codium. First, it comes with support for coding built in — there is support for source control and most importantly debugging available with no additional setup. This is why I switched to VS Codium for Rust during the Advent of Code.

The second reason is the easy configuration and extensibility — there are thousands of extensions for things like cloud computing, additional languages, and themes. This makes it an ideal coding editor, as you can work on multiple languages and configure the editor just the way you want it.

Emacs

I mentioned that VS Codium was my fallback editor for Rust coding because of the built-in debugging support. Until then, I used my favorite editor of all time.

Veterans of the Editor War may have figured out that I am on Team Emacs. Ever since I saw and used it on a Sun workstation back in the mid-1980’s, I’ve been hooked. It is one of the oldest still active free software projects in existence, with the first versions dating back to the 1970’s.

Emacs with the Doom logo.
Emacs with the Doom logo.

Emacs is a great general purpose editor, but it’s strength lies in it’s configurability. However, configuring Emacs can be a bit of a chore. The configuration language is a form of LISP called Emacs Lisp (or ELisp for short). In other words, to configure Emacs to be a great coding editor, you need to write code. Yes, this sounds like the first layer of Inception to me too.

However, there are ways to make this easier. Now, this isn’t a primer on how to setup or use Emacs — if you want that, try here. What this is, is a rundown of what I have settled on, a configuration framework called Doom Emacs, which provides a curated set of packages with sane defaults and a modular structure for configuring them.

In the next interlude post, I’ll dig into my Emacs configuration to show you what I use for Rust and other coding, and how I finally got debugging to work.

Other Coding Editors

There are a few other coding editors I’ve used over the years — you may want to explore these on your own. Depending on your platform, I recommend looking at:

If none of these works for, then check out AlternativeTo, a site which will give you great alternatives to popular software, filterable by your platform.

Conclusion

There are a ton of editors out there — what do you use? Got any tips for me? Something I missed? Drop me a note below!