All operating systems come with a basic text editor — Windows comes with Notepad and MacOS comes with TextEdit. These editors will work just fine, but most web developers use third-party editors with specialized tools and features for writing code. Some of the most popular text editors include Visual Studio Code, Brackets, and Sublime Text.
There are also web application-based text editors that allow you to write code directly from within your browser. They’re becoming popular for enabling developers to edit code on any device and for automatically saving code to the cloud. These text editors are also great for novice developers since they don’t require any setup besides registering for a user account. Popular online text editors include repl.it and jsfiddle.net.
There can be many subtle differences between different text editors so we recommend putting some thought into deciding which to use. Most editors, including the ones we mentioned, will include features that are essential for writing code like syntax highlighting and code completion.
Syntax highlighting is a feature that displays source code in different colors and fonts that correspond with a coding language’s grammar. It helps make code easier to read and write because there’s a visual distinction between different parts of the code.
Code completion helps reduce the number of keystrokes used to write code. It’s similar to how auto-complete or predictive text might help you compose text messages on a mobile device.
You may have also seen the term, IDE, or Integrated Development Environment. These are programs that combine several different tools into a single application. Most IDEs consist of a text editor, tools for building executables, and a debugger. They’re often created specifically for writing code in a particular language. For example, Eclipse IDE is primarily used to write Java and PyCharm is used to write Python.
In general, web developers don’t need an IDE to help them run or debug code because most of the code they write will run in a web browser.
In general, code is loaded and executed in the order it appears on a page, from top to bottom. Every time you navigate to a new page, the process will start over again. The browser will wipe away any code related to the previous page and load in code for the new page. Then, it will run the code and make the contents of the new page appear on the screen. Also, each browser tab has its own “world” and runs code separately from other tabs. This ensures that code in one tab won’t conflict with code in another tab. It’s also a good security measure, because it prevents potentially sensitive information from one tab from leaking to another tab.
When the browser sees this, it will load and execute the contents of the file at that URL.