A source-code editor is a
text editor
A text editor is a type of computer program that edits plain text. An example of such program is "notepad" software (e.g. Windows Notepad). Text editors are provided with operating systems and software development packages, and can be used to c ...
program designed specifically for editing
source code
In computing, source code, or simply code or source, is a plain text computer program written in a programming language. A programmer writes the human readable source code to control the behavior of a computer.
Since a computer, at base, only ...
of
computer program
A computer program is a sequence or set of instructions in a programming language for a computer to Execution (computing), execute. It is one component of software, which also includes software documentation, documentation and other intangibl ...
s. It may be a standalone application or it may be built into an
integrated development environment
An integrated development environment (IDE) is a Application software, software application that provides comprehensive facilities for software development. An IDE normally consists of at least a source-code editor, build automation tools, an ...
(IDE).
Features
Source-code editors have features specifically designed to simplify and speed up typing of source code, such as
syntax highlighting
Syntax highlighting is a feature of text editors that is used for programming language, programming, scripting language, scripting, or markup language, markup languages, such as HTML. The feature displays text, especially source code, in differe ...
,
indentation
__FORCETOC__
In the written form of many languages, indentation describes empty space ( white space) used before or around text to signify an important aspect of the text such as:
* Beginning of a paragraph
* Hierarchy subordinate concept
* Qu ...
,
autocomplete
Autocomplete, or word completion, is a feature in which an application software, application predicts the rest of a word a user is typing. In Android (operating system), Android and iOS smartphones, this is called predictive text. In graphical us ...
and
brace matching functionality. These editors may also provide a convenient way to run a
compiler
In computing, a compiler is a computer program that Translator (computing), translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primaril ...
,
interpreter
Interpreting is translation from a spoken or signed language into another language, usually in real time to facilitate live communication. It is distinguished from the translation of a written text, which can be more deliberative and make use o ...
,
debugger
A debugger is a computer program used to test and debug other programs (the "target" programs). Common features of debuggers include the ability to run or halt the target program using breakpoints, step through code line by line, and display ...
, or other program relevant for the
software-development process. So, while many text editors like
Notepad
A notebook (also known as a notepad, writing pad, drawing pad, or legal pad) is a book or stack of paper pages that are often Ruled paper, ruled and used for purposes such as note-taking, Diary, journaling or other writing, drawing, or scrapbooki ...
can be used to edit source code, if they do not enhance, automate or ease the editing of code, they are not ''source-code editors''.
Structure editors are a different form of source-code editor, where instead of editing raw text, one manipulates the code's structure, generally the
abstract syntax tree
An abstract syntax tree (AST) is a data structure used in computer science to represent the structure of a program or code snippet. It is a tree representation of the abstract syntactic structure of text (often source code) written in a formal ...
. In this case features such as syntax highlighting, validation, and code formatting are easily and efficiently implemented from the
concrete syntax tree
A parse tree or parsing tree (also known as a derivation tree or concrete syntax tree) is an ordered, rooted tree that represents the syntactic structure of a string according to some context-free grammar. The term ''parse tree'' itself is used p ...
or abstract syntax tree, but editing is often more rigid than free-form text. Structure editors also require extensive support for each language, and thus are harder to extend to new languages than text editors, where basic support only requires supporting syntax highlighting or indentation. For this reason, strict structure editors are not popular for source code editing, though some IDEs provide similar functionality.
A source-code editor can check syntax while code is being entered and immediately warn of syntax problems. A few source-code editors compress source code, typically converting common keywords into
single-byte tokens, removing unnecessary whitespace, and converting numbers to a binary form. Such tokenizing editors later uncompress the source code when viewing it, possibly
prettyprinting it with consistent capitalization and spacing. A few source-code editors do both.
The
Language Server Protocol, first used in Microsoft's
Visual Studio Code
Visual Studio Code, commonly referred to as VS Code, is an integrated development environment developed by Microsoft for Windows, Linux, macOS and web browsers. Features include support for debugging, syntax highlighting, intelligent code comp ...
, allows for source code editors to implement an LSP client that can read syntax information about any language with a LSP server. This allows for source code editors to easily support more languages with syntax highlighting, refactoring, and reference finding.
Many source code editors such as Neovim
and Brackets
have added a built-in LSP client while other editors such as Emacs,
vim,
and Sublime Text
have support for an LSP Client via a separate plug-in.
History
In 1985,
Mike Cowlishaw of
IBM
International Business Machines Corporation (using the trademark IBM), nicknamed Big Blue, is an American Multinational corporation, multinational technology company headquartered in Armonk, New York, and present in over 175 countries. It is ...
created
LEXX
''Lexx'' (also known as ''LEXX: The Dark Zone Stories'' and ''Tales from a Parallel Universe'') is a science fiction television series created by Lex Gigeroff and brothers Paul Donovan (writer), Paul and Michael Donovan (producer), Michael Dono ...
while
seconded to the
Oxford University Press
Oxford University Press (OUP) is the publishing house of the University of Oxford. It is the largest university press in the world. Its first book was printed in Oxford in 1478, with the Press officially granted the legal right to print books ...
. LEXX used live parsing and used color and fonts for syntax highlighting. IBM's LPEX (Live Parsing Extensible Editor)
was based on LEXX and ran on
VM/CMS
VM (often: VM/CMS) is a family of IBM virtual machine operating systems used on IBM mainframes System/370, System/390, zSeries, System z and compatible systems, including the Hercules emulator for personal computers.
Design
The heart o ...
,
OS/2
OS/2 is a Proprietary software, proprietary computer operating system for x86 and PowerPC based personal computers. It was created and initially developed jointly by IBM and Microsoft, under the leadership of IBM software designer Ed Iacobucci, ...
,
OS/400,
Windows
Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
, and
Java
Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
Although the initial public release of
vim was in 1991, the syntax highlighting feature was not introduced until version 5.0 in 1998. On November 1, 2015, the first version of
NeoVim
Vim (;
: "Vim is pronounced as one word, like Jim, not vi-ai-em. It's written with a capital, since it's a name, again like Jim." ...
was released.
In 2003,
Notepad++, a source code editor for Windows, was released by Don Ho. The intention was to create an alternative to the java-based source code editor, JEXT
In 2015,
Microsoft
Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
released Visual Studio Code as a lightweight and cross-platform alternative to their
Visual Studio
Visual Studio is an integrated development environment (IDE) developed by Microsoft. It is used to develop computer programs including web site, websites, web apps, web services and mobile apps. Visual Studio uses Microsoft software development ...
IDE.
The following year, Visual Studio Code became the Microsoft product using the Language Server Protocol.
This code editor quickly gained popularity and emerged as the most widely used source code editor.
Comparison with IDEs
A source-code editor is one component of a Integrated Development Environment. In contrast to a standalone source-code editor, an IDE typically also includes debugger and build tools.
Standalone source code editors are preferred over IDEs by some developers when they believe the IDEs are bloated with features they do not need.
Notable examples
*
Atom
Atoms are the basic particles of the chemical elements. An atom consists of a atomic nucleus, nucleus of protons and generally neutrons, surrounded by an electromagnetically bound swarm of electrons. The chemical elements are distinguished fr ...
*
Brackets
A bracket is either of two tall fore- or back-facing punctuation marks commonly used to isolate a segment of text or data from its surroundings. They come in four main pairs of shapes, as given in the box to the right, which also gives their n ...
*
Eclipse
An eclipse is an astronomical event which occurs when an astronomical object or spacecraft is temporarily obscured, by passing into the shadow of another body or by having another body pass between it and the viewer. This alignment of three ...
*
Emacs
Emacs (), originally named EMACS (an acronym for "Editor Macros"), is a family of text editors that are characterized by their extensibility. The manual for the most widely used variant, GNU Emacs, describes it as "the extensible, customizable, s ...
*
Gedit
*
NetBeans
NetBeans is an integrated development environment (IDE) for Java (programming language), Java. NetBeans allows applications to be developed from a set of modular software components called ''modules''. NetBeans runs on Microsoft Windows, Windows, ...
*
Notepad++ (Windows only)
*
SlickEdit
*
Sublime Text
*
TextMate (macOS only)
*
UltraEdit
*
vi/
Vim
*
Visual Studio Code
Visual Studio Code, commonly referred to as VS Code, is an integrated development environment developed by Microsoft for Windows, Linux, macOS and web browsers. Features include support for debugging, syntax highlighting, intelligent code comp ...
Controversy
Many source-code editors and IDEs have been involved in ongoing user arguments, sometimes referred to jovially as "holy wars" by the programming community.
Notable examples include
vi vs. Emacs and
Eclipse
An eclipse is an astronomical event which occurs when an astronomical object or spacecraft is temporarily obscured, by passing into the shadow of another body or by having another body pass between it and the viewer. This alignment of three ...
vs.
NetBeans
NetBeans is an integrated development environment (IDE) for Java (programming language), Java. NetBeans allows applications to be developed from a set of modular software components called ''modules''. NetBeans runs on Microsoft Windows, Windows, ...
. These arguments have formed a significant part of
internet culture
Internet culture refers to culture developed and maintained among frequent and active users of the Internet (also known as netizens) who primarily communicate with one another as members of online communities; that is, a culture whose influence ...
and they often start whenever either editor is mentioned anywhere.
See also
*
Integrated development environment
An integrated development environment (IDE) is a Application software, software application that provides comprehensive facilities for software development. An IDE normally consists of at least a source-code editor, build automation tools, an ...
*
Comparison of integrated development environments
The following tables list notable software packages that are nominal IDEs; standalone tools such as source-code editors and GUI builders are not included. These IDEs are listed in alphabetic order of the supported language.
ActionScript
A ...
*
Comparison of online source code playgrounds
*
*
Comparison of JavaScript-based source code editors
This article provides basic feature comparison between some of the JavaScript-based source code editors available today.
Overview
List of features
Feature testing was performed with Firefox 3.0.6 against the current demo version, and results m ...
*
Comparison of hex editors
*
Comparison of HTML editors
*
List of text editors
The following is a list of notable text editors.
Graphical and text user interface
The following editors can either be used with a graphical user interface or a text user interface.
Graphical user interface
Text user interface
Sys ...
*
Editor war
References
{{Reflist
*
Programming tools
Types of tools used in software development