Source-code editor: Difference between revisions

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
Features: Fixed "provide" into "may provide" as code editors do not necessarily provide a convenient way to use a debugger, etc... specially on mobile phones.
 
imported>TronicsA3
expand short description + improve grammar and wording + add features list + add links + expand 'Comparison with IDE's' section
 
Line 1: Line 1:
{{Short description|Text editor specializing in software code}}
{{Short description|Text editor specializing in software code}}
{{Multiple issues|
{{Lead too short|date=September 2024}}
{{Lead too short|date=September 2024}}
{{More citations needed|date=October 2025}}
}}
[[File:Notepad++ v5.1.PNG |thumb |Screenshot of using [[Notepad++]] to edit [[XML]] code]]
[[File:Notepad++ v5.1.PNG |thumb |Screenshot of using [[Notepad++]] to edit [[XML]] code]]
A '''source-code editor''' is a [[text editor]] program designed specifically for editing [[source code]] of [[computer program]]s. It may be a standalone application or it may be built into an [[integrated development environment]] (IDE).
A '''source-code editor''' is a [[text editor]] program designed specifically for editing the [[source code]] of [[computer program]]s. It includes basic functionality such as syntax highlighting, and sometimes debugging. It may be a standalone application or it may be built into an [[integrated development environment]] (IDE).<ref name=":0">{{Cite web |date=2024-11-15 |title=Difference between IDE and Code editor |url=https://www.geeksforgeeks.org/blogs/ide-vs-code-editor/ |access-date=2025-12-14 |website=GeeksforGeeks |language=en-US}}</ref>


==Features==
==Features==
Source-code editors have features specifically designed to simplify and speed up typing of source code, such as [[syntax highlighting]], [[Indentation style|indentation]], [[autocomplete]] and [[brace matching]] functionality. These editors may also provide a convenient way to run a [[compiler]], [[Interpreter (computing)|interpreter]], [[debugger]], or other program relevant for the [[software-development process]]. So, while many text editors like [[Microsoft Notepad|Notepad]] 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''.
Source-code editors have features specifically designed to simplify and speed up typing of source code, such as [[syntax highlighting]], [[Indentation style|indentation]], [[autocomplete]] and [[brace matching]] functionality. These editors may also provide a convenient way to run a [[compiler]], [[Interpreter (computing)|interpreter]], [[debugger]], or other program relevant for the [[software-development process]]. While many text editors like [[Microsoft Notepad|Notepad]] can be used to edit source code, if they do not enhance, automate or ease the editing of code, they are not defined as ''source-code editors''.


[[Structure editor]]s 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]]. In this case features such as syntax highlighting, validation, and code formatting are easily and efficiently implemented from the [[concrete syntax tree]] 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.
[[Structure editor]]s are a different form of a source-code editor, where instead of editing raw text, one manipulates the code's structure, generally the [[abstract syntax tree]]. In this case features such as syntax highlighting, validation, and code formatting are easily and efficiently implemented from the [[concrete syntax tree]] 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 <!-- such as [[PBASIC]], the [[Applesoft BASIC]] editor, the [[Commodore BASIC]] editor --> compress source code, typically converting common keywords into [[BASIC interpreter#Tokenizing and encoding lines | 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 [[prettyprint]]ing it with consistent capitalization and spacing. A few source-code editors do both.{{citation needed|date=June 2022}}
A source-code editor can check syntax dynamically while code is being entered and immediately warn of syntax problems, as well as suggest code autocomplete snippets. A few source-code editors <!-- such as [[PBASIC]], the [[Applesoft BASIC]] editor, the [[Commodore BASIC]] editor --> compress source code, typically converting common keywords into [[BASIC interpreter#Tokenizing and encoding lines |single-byte tokens]], removing unnecessary whitespace, and converting numbers to a [[Binary number|binary]] form. Such tokenizing editors later uncompress the source code when viewing it, possibly [[prettyprint]]ing it with consistent capitalization and spacing. A few source-code editors do both.{{citation needed|date=June 2022}}


The [[Language Server Protocol]], first used in Microsoft's [[Visual Studio Code]], 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.<ref name="Krill 2016">{{cite web |last1=Krill |first1=Paul |title=Microsoft-backed Language Server Protocol strives for language, tools interoperability |url=https://www.infoworld.com/article/3088698/microsoft-backed-langauge-server-protocol-strives-for-language-tools-interoperability.html |website=InfoWorld |access-date=19 June 2022 |language=en |date=27 June 2016}}</ref> Many source code editors such as Neovim<ref name="neovim LSP">{{cite web |title=LSP documentation - Neovim |url=https://neovim.io/doc/lsp/ |website=neovim.io |access-date=19 June 2022}}</ref> and Brackets<ref name="Shubham 2019">{{cite web |last1=Shubham |first1=Yadav |title=Language Server Protocol Support in Brackets · adobe/brackets Wiki |url=https://github.com/adobe/brackets/wiki/Language-Server-Protocol-Support-in-Brackets |website=GitHub |access-date=19 June 2022 |language=en}}</ref> have added a built-in LSP client while other editors such as Emacs,<ref name="Emacs LSP">{{cite web |title=LSP Mode - Language Server Protocol support for Emacs - LSP Mode - LSP support for Emacs |url=https://emacs-lsp.github.io/lsp-mode/ |website=emacs-lsp.github.io |access-date=19 June 2022}}</ref> vim,<ref name="Devlieghere 2018">{{cite web |last1=Devlieghere |first1=Jonas |title=Using LSP & clangd in Vim |url=https://jonasdevlieghere.com/vim-lsp-clangd/ |website=Jonas Devlieghere |access-date=19 June 2022 |language=en |date=22 April 2018}}</ref> and Sublime Text<ref name="LSP Sublime">{{cite web |title=Home - Sublime Text Language Server Protocol Documentation |url=https://lsp.readthedocs.io/en/latest/ |website=lsp.readthedocs.io |access-date=19 June 2022 |archive-date=12 June 2022 |archive-url=https://web.archive.org/web/20220612152851/https://lsp.readthedocs.io/en/latest/ |url-status=dead }}</ref> have support for an LSP Client via a separate plug-in.
The [[Language Server Protocol]], first used in Microsoft's [[Visual Studio Code]], 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.<ref name="Krill 2016">{{cite web |last1=Krill |first1=Paul |title=Microsoft-backed Language Server Protocol strives for language, tools interoperability |url=https://www.infoworld.com/article/3088698/microsoft-backed-langauge-server-protocol-strives-for-language-tools-interoperability.html |website=InfoWorld |access-date=19 June 2022 |language=en |date=27 June 2016}}</ref> Many source code editors such as Neovim<ref name="neovim LSP">{{cite web |title=LSP documentation - Neovim |url=https://neovim.io/doc/lsp/ |website=neovim.io |access-date=19 June 2022}}</ref> and Brackets<ref name="Shubham 2019">{{cite web |last1=Shubham |first1=Yadav |title=Language Server Protocol Support in Brackets · adobe/brackets Wiki |url=https://github.com/adobe/brackets/wiki/Language-Server-Protocol-Support-in-Brackets |website=GitHub |access-date=19 June 2022 |language=en}}</ref> have added a built-in LSP client while other editors such as Emacs,<ref name="Emacs LSP">{{cite web |title=LSP Mode - Language Server Protocol support for Emacs - LSP Mode - LSP support for Emacs |url=https://emacs-lsp.github.io/lsp-mode/ |website=emacs-lsp.github.io |access-date=19 June 2022}}</ref> [[Vim (text editor)|Vim]],<ref name="Devlieghere 2018">{{cite web |last1=Devlieghere |first1=Jonas |title=Using LSP & clangd in Vim |url=https://jonasdevlieghere.com/vim-lsp-clangd/ |website=Jonas Devlieghere |access-date=19 June 2022 |language=en |date=22 April 2018}}</ref> and [[Sublime Text]]<ref name="LSP Sublime">{{cite web |title=Home - Sublime Text Language Server Protocol Documentation |url=https://lsp.readthedocs.io/en/latest/ |website=lsp.readthedocs.io |access-date=19 June 2022 |archive-date=12 June 2022 |archive-url=https://web.archive.org/web/20220612152851/https://lsp.readthedocs.io/en/latest/ |url-status=dead }}</ref> have support for an LSP Client via a separate plug-in.


==History==
==History==
Line 33: Line 36:
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<ref name="Orin 2015">{{cite web |last1=Orin |first1=Andy |title=Behind The App: The Story Of Notepad++ |url=https://www.lifehacker.com.au/2015/06/behind-the-app-the-story-of-notepad/ |website=Lifehacker Australia |access-date=17 June 2022 |language=en-AU |date=18 June 2015}}</ref>  
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<ref name="Orin 2015">{{cite web |last1=Orin |first1=Andy |title=Behind The App: The Story Of Notepad++ |url=https://www.lifehacker.com.au/2015/06/behind-the-app-the-story-of-notepad/ |website=Lifehacker Australia |access-date=17 June 2022 |language=en-AU |date=18 June 2015}}</ref>  


In 2015, [[Microsoft]] released Visual Studio Code as a lightweight and cross-platform alternative to their [[Visual Studio]] IDE.<ref name="Somesegar 2015">{{cite web |last1=Somasegar |first1=S |title=Introducing Visual Studio Code, Visual Studio 2015 RC, Application Insights Public Preview and .NET Core Preview for Linux and Mac - Somasegar's blog - Site Home - MSDN Blogs |url=http://blogs.msdn.com/b/somasegar/archive/2015/04/29/introducing-visual-studio-code-visual-studio-2015-rc-application-insights-public-preview-and-net-core-for-linux-and-mac.aspx |website=blogs.msdn.com/ |publisher=Microsoft |access-date=17 June 2022 |date=4 July 2015 |archive-url=https://web.archive.org/web/20150704023456/http://blogs.msdn.com/b/somasegar/archive/2015/04/29/introducing-visual-studio-code-visual-studio-2015-rc-application-insights-public-preview-and-net-core-for-linux-and-mac.aspx |archive-date=4 July 2015 |url-status=dead}}</ref> The following year, Visual Studio Code became the Microsoft product using the Language Server Protocol.<ref name="Krill 2016"/> This code editor quickly gained popularity and emerged as the most widely used source code editor.<ref>{{Cite web |title=Stack Overflow Developer Survey 2021 |url=https://survey.stackoverflow.co/2021#overview |access-date=2025-01-29 |website=Stack Overflow |language=en}}</ref>{{better source|date=January 2025}}
In 2015, [[Microsoft]] released [[Visual Studio Code]] as a lightweight and cross-platform alternative to their [[Visual Studio]] IDE.<ref name="Somesegar 2015">{{cite web |last1=Somasegar |first1=S |title=Introducing Visual Studio Code, Visual Studio 2015 RC, Application Insights Public Preview and .NET Core Preview for Linux and Mac - Somasegar's blog - Site Home - MSDN Blogs |url=http://blogs.msdn.com/b/somasegar/archive/2015/04/29/introducing-visual-studio-code-visual-studio-2015-rc-application-insights-public-preview-and-net-core-for-linux-and-mac.aspx |website=blogs.msdn.com/ |publisher=Microsoft |access-date=17 June 2022 |date=4 July 2015 |archive-url=https://web.archive.org/web/20150704023456/http://blogs.msdn.com/b/somasegar/archive/2015/04/29/introducing-visual-studio-code-visual-studio-2015-rc-application-insights-public-preview-and-net-core-for-linux-and-mac.aspx |archive-date=4 July 2015 |url-status=dead}}</ref> The following year, Visual Studio Code became the Microsoft product using the Language Server Protocol.<ref name="Krill 2016"/> This code editor quickly gained popularity and emerged as the most widely used source code editor.<ref>{{Cite web |title=Stack Overflow Developer Survey 2021 |url=https://survey.stackoverflow.co/2021#overview |access-date=2025-01-29 |website=Stack Overflow |language=en}}</ref>{{better source|date=January 2025}}


==Comparison with IDEs==
==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.
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 several tools which enhance the software development process.<ref name=":0" /> Such tools include syntax highlighting, code autocomplete suggestions, version control, automatic formatting, integrated runtime environments, debugger, and build tools.<ref>{{Cite web |title=Ada Computer Science |url=https://adacomputerscience.org/concepts/soft_ide |access-date=2025-12-14 |website=Ada Computer Science |language=en}}</ref>


Standalone source code editors are preferred over IDEs by some developers when they believe the IDEs are bloated with features they do not need.<ref name="Petreley 2003">{{cite web |last1=Petreley |first1=Nicholas |title=Java text editing software for Linux |url=https://www.computerworld.com/article/2579485/java-text-editing-software-for-linux.html |website=Computer World |access-date=17 June 2022 |date=11 Feb 2003}}</ref>
Standalone source code editors are preferred over IDEs by some developers when they believe the IDEs are bloated with features they do not need.<ref name="Petreley 2003">{{cite web |last1=Petreley |first1=Nicholas |title=Java text editing software for Linux |url=https://www.computerworld.com/article/2579485/java-text-editing-software-for-linux.html |website=Computer World |access-date=17 June 2022 |date=11 Feb 2003}}</ref>
Line 47: Line 50:
*[[Emacs]]
*[[Emacs]]
*[[Gedit]]
*[[Gedit]]
*[[Kate (text editor)|Kate]]
*[[NetBeans]]
*[[NetBeans]]
*[[Notepad++]] (Windows only)
*[[Notepad++]] (Windows only)
Line 64: Line 68:
* [[Comparison of online source code playgrounds]]
* [[Comparison of online source code playgrounds]]
* {{section link|Comparison of text editors|Programming features}}
* {{section link|Comparison of text editors|Programming features}}
* [[Comparison of JavaScript-based source code editors]]
* [[Comparison of hex editors]]
* [[Comparison of hex editors]]
* [[Comparison of HTML editors]]
* [[Comparison of HTML editors]]

Latest revision as of 12:36, 14 December 2025

Template:Short description Script error: No such module "Unsubst".

File:Notepad++ v5.1.PNG
Screenshot of using Notepad++ to edit XML code

A source-code editor is a text editor program designed specifically for editing the source code of computer programs. It includes basic functionality such as syntax highlighting, and sometimes debugging. It may be a standalone application or it may be built into an integrated development environment (IDE).[1]

Features

Source-code editors have features specifically designed to simplify and speed up typing of source code, such as syntax highlighting, indentation, autocomplete and brace matching functionality. These editors may also provide a convenient way to run a compiler, interpreter, debugger, or other program relevant for the software-development process. While many text editors like Notepad can be used to edit source code, if they do not enhance, automate or ease the editing of code, they are not defined as source-code editors.

Structure editors are a different form of a source-code editor, where instead of editing raw text, one manipulates the code's structure, generally the abstract syntax tree. In this case features such as syntax highlighting, validation, and code formatting are easily and efficiently implemented from the concrete syntax tree 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 dynamically while code is being entered and immediately warn of syntax problems, as well as suggest code autocomplete snippets. 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.Script error: No such module "Unsubst".

The Language Server Protocol, first used in Microsoft's Visual Studio Code, 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.[2] Many source code editors such as Neovim[3] and Brackets[4] have added a built-in LSP client while other editors such as Emacs,[5] Vim,[6] and Sublime Text[7] have support for an LSP Client via a separate plug-in.

History

Script error: No such module "Unsubst".

In 1985, Mike Cowlishaw of IBM created LEXX while seconded to the Oxford University Press. LEXX used live parsing and used color and fonts for syntax highlighting. IBM's LPEX (Live Parsing Extensible Editor)[8] was based on LEXX and ran on VM/CMS, OS/2, OS/400, Windows, and Java[9]

Although the initial public release of vim was in 1991, the syntax highlighting feature was not introduced until version 5.0 in 1998.[10]Template:Better source needed On November 1, 2015, the first version of NeoVim was released.[11]

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[12]

In 2015, Microsoft released Visual Studio Code as a lightweight and cross-platform alternative to their Visual Studio IDE.[13] The following year, Visual Studio Code became the Microsoft product using the Language Server Protocol.[2] This code editor quickly gained popularity and emerged as the most widely used source code editor.[14]Template:Better source

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 several tools which enhance the software development process.[1] Such tools include syntax highlighting, code autocomplete suggestions, version control, automatic formatting, integrated runtime environments, debugger, and build tools.[15]

Standalone source code editors are preferred over IDEs by some developers when they believe the IDEs are bloated with features they do not need.[16]

Notable examples

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.[17]Template:Better source needed Notable examples include vi vs. Emacs and Eclipse vs. NetBeans. These arguments have formed a significant part of internet culture and they often start whenever either editor is mentioned anywhere.

See also

References

<templatestyles src="Reflist/styles.css" />

  1. a b Script error: No such module "citation/CS1".
  2. a b Script error: No such module "citation/CS1".
  3. Script error: No such module "citation/CS1".
  4. Script error: No such module "citation/CS1".
  5. Script error: No such module "citation/CS1".
  6. Script error: No such module "citation/CS1".
  7. Script error: No such module "citation/CS1".
  8. Script error: No such module "citation/CS1".
  9. Script error: No such module "citation/CS1".
  10. Script error: No such module "citation/CS1".
  11. Script error: No such module "citation/CS1".
  12. Script error: No such module "citation/CS1".
  13. Script error: No such module "citation/CS1".
  14. Script error: No such module "citation/CS1".
  15. Script error: No such module "citation/CS1".
  16. Script error: No such module "citation/CS1".
  17. Script error: No such module "citation/CS1".

Script error: No such module "Check for unknown parameters".