Text Editor
What is a Text Editor?
Code is written in text files.
The file will usually have an extension to indicate what language it's written
in (such as .jsh
for jshell scripts and .java
for Java source code), but
it's fundamentally the same as a .txt file.
A text file contains text with no formatting.
You cannot make some text bold, change its color, align it to the right
margin, etc.
A text editor can display formatted and colored text, but none of this
formatting is part of the text file.
Text files are different from .rtf (rich text files), .doc/.docx (Word Documents), PDF files, and Google Doc files. Those filetypes all contain formatting in addition to the text, and programs like Microsoft Word and Google Docs should never be used to write code.
To write code, you need a text editor. Most operating systems include a basic editor with very few features (such as notepad on Windows), but there are much more powerful editors developed specifically for writing code. These editors include many features that make writing code faster and easier than it would be in a program like notepad.
Recommended Text Editor: VS Code
VS Code is a relatively new and very popular editor developed by Microsoft. It is widely used by software developers, includes many useful modern features, and can be customized with numerous plugins. I recommend using it unless you have a good reason to go with another editor.
Zach's Editor: Neovim
Neovim is a highly customizable text editor with a difficult learning curve, and I do not recommend using it for this class. I mention it only because it's the editor I use, so you'll be seeing it a lot if you're in my class or watching any of my videos. If you like the idea of an editor that requires a lot of effort to learn, but will pay off that effort by letting you edit text very quickly and without using a mouse, then it might be worth trying neovim (or regular vim, or Emacs). However, I don't expect most students to find learning one of these editors to be worth the effort right now, and that's why I recommend VS Code.
Learning Resources
- Official VS Code tutorial: https://www.youtube.com/watch?v=B-s71n0dHUk
- Guide to vim: https://github.com/iggredible/Learn-Vim/blob/master/ch00_read_this_first.md
- Interactive vim tutorial: https://www.openvim.com/
- Guided tour of Emacs: https://www.gnu.org/software/emacs/tour/
A final piece of advice: find an editor that you like and learn to use it well. You'll have a much better time coding if you can take advantage of many of the features your preferred editor has to offer than if you switch constantly and never learn much about any one editor.