Jump to content

Source-code editor: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Notable examples: Atom, Brackets, Sublime and UltraEdit are also cross-platform
Undid revision 1251392007 by 197.218.43.84 (talk)
 
(42 intermediate revisions by 31 users not shown)
Line 1: Line 1:
{{Short description|Text editor specializing in software code}}
{{Short description|Text editor specializing in software code}}
{{Lead too short|date=September 2024}}
[[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) or [[web browser]]. Source-code editors are a fundamental [[programming tool]], as the fundamental job of programmers is to write and edit source 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).


==Characteristics==
==Features==
Source-code editors have characteristics 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 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 don't 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 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''.


[[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 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 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 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}}


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}}</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,<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==
{{POV|section|date=June 2022}}
{{Expand section
{{Expand section
|small=no
|small=no
|talksection="History" section
|talksection="History" section
|date=June 2022}}
|date=March 2024}}


In 1985, [[Mike Cowlishaw]] of [[IBM]] created [[LEXX (text editor)|LEXX]] while [[Secondment|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)<ref name="LPEX User Guide">{{cite web |title=LPEX Editor's User Guide - Version 4 |url=https://www.ibm.com/support/pages/system/files/support/swg/swgdocs.nsf/0/b056dfda5f29d02a85256ab000109653/$FILE/lpex.pdf |website=IBM |access-date=19 June 2022}}</ref> was based on LEXX and ran on [[VM (operating system)|VM/CMS]], [[OS/2]], [[IBM i|OS/400]], [[Microsoft Windows|Windows]], and [[Java virtual machine|Java]]<ref name="Cowlishaw Bio">{{citation
In 1985, [[Mike Cowlishaw]] of [[IBM]] created [[LEXX (text editor)|LEXX]] while [[Secondment|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)<ref name="LPEX User Guide">{{cite web |title=LPEX Editor's User Guide - Version 4 |url=https://www.ibm.com/support/pages/system/files/support/swg/swgdocs.nsf/0/b056dfda5f29d02a85256ab000109653/$FILE/lpex.pdf |website=IBM |access-date=19 June 2022}}</ref> was based on LEXX and ran on [[VM (operating system)|VM/CMS]], [[OS/2]], [[IBM i|OS/400]], [[Microsoft Windows|Windows]], and [[Java virtual machine|Java]]<ref name="Cowlishaw Bio">{{citation
Line 36: Line 36:


==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.<ref name="Ayush 2018">{{cite web |last1=Ayush |title=10 Best IDEs For Programmers And Developers |url=https://www.technotification.com/2018/05/10-best-ides-for-programmers-and-developers.html |website=Technotification |access-date=18 June 2022 |date=21 May 2018}}</ref>
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.<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 42: Line 42:
==Notable examples==
==Notable examples==
<!-- Do not add to this list without talk page discussion. If you have *reliable sources* for your editor being one of the TOP FEW most POPULAR or WELL-KNOWN SCE's, then bring them to talk page. All additions without discussion WILL BE DELETED. -->
<!-- Do not add to this list without talk page discussion. If you have *reliable sources* for your editor being one of the TOP FEW most POPULAR or WELL-KNOWN SCE's, then bring them to talk page. All additions without discussion WILL BE DELETED. -->
*[[Atom (text editor)|Atom]]<ref name="APEX" /> (cross-platform, including Linux, macOS, Windows)
*[[Atom (text editor)|Atom]]<ref name="APEX" />
*[[Brackets (text editor)|Brackets]]<ref name="APEX" /> (cross-platform, including Linux, macOS, Windows)
*[[Brackets (text editor)|Brackets]]<ref name="APEX" />
*[[Eclipse (software)|Eclipse]] (cross-platform, including Linux, macOS, Windows)
*[[Eclipse (software)|Eclipse]]
*[[Emacs]]
*[[Emacs]] (cross-platform, including [[Unix]], Linux, macOS, Windows)
*[[Gedit]]
*[[Gedit]] (cross-platform, including Linux, macOS, Windows)
*[[NetBeans]]
*[[NetBeans]]
*[[Notepad++]]<ref name="APEX" /> (Windows)
*[[Notepad++]]<ref name="APEX" /> (Windows only)
*[[SlickEdit]]
*[[SlickEdit]] (cross-platform, including Linux, macOS, Windows, [[Solaris (operating system)|Solaris]], [[HP-UX]], [[AIX]])
*[[Sublime Text]]<ref name="APEX">{{cite web |title=Global Text Editor Market By Product Type (Cloud Based, Web Based) And By End-Users/Application (Large Enterprises, SMEs) Global Market Share, Forecast Data, In-Depth Analysis, And Detailed Overview, and Forecast, 2013 - 2026 |url=https://www.apexmarketsresearch.com/report/global-text-editor-market-by-product-type-cloud-468736/ |quote=The major players operating into Text Editor Market include: Visual Studio Code, Notepad++, Sublime, Brackets, UltraEdit, Atom}}</ref> (cross-platform, including Linux, macOS, Windows)
*[[Sublime Text]]<ref name="APEX">{{cite web |title=Global Text Editor Market By Product Type (Cloud Based, Web Based) And By End-Users/Application (Large Enterprises, SMEs) Global Market Share, Forecast Data, In-Depth Analysis, And Detailed Overview, and Forecast, 2013–2026 |url=https://www.apexmarketsresearch.com/report/global-text-editor-market-by-product-type-cloud-468736/ |quote=The major players operating into Text Editor Market include: Visual Studio Code, Notepad++, Sublime, Brackets, UltraEdit, Atom}}</ref>
*[[TextMate]] (macOS)
*[[TextMate]] (macOS only)
*[[UltraEdit]]<ref name="APEX" /> (cross-platform, including Linux, macOS, Windows)
*[[UltraEdit]]<ref name="APEX" />
*[[vi]]/[[Vim (text editor)|Vim]] (cross-platform, including Unix, Linux, macOS, Windows)
*[[Vi (text editor)|vi]]/[[Vim (text editor)|Vim]]
*[[Visual Studio Code]]<ref name="APEX" /> (cross-platform, including Linux, macOS, Windows)
*[[Visual Studio Code]]<ref name="APEX" />


==Controversy==
==Controversy==
Line 68: Line 68:
* [[Comparison of HTML editors]]
* [[Comparison of HTML editors]]
* [[List of text editors]]
* [[List of text editors]]
* [[Editor War]]
* [[Editor war]]


==References==
==References==

Latest revision as of 10:03, 20 October 2024

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 programs. It may be a standalone application or it may be built into an integrated development environment (IDE).

Features

[edit]

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 also provide a convenient way to run a compiler, interpreter, debugger, or other program relevant for the software-development process. So, 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 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. 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 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.[citation needed]

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.[1] Many source code editors such as Neovim[2] and Brackets[3] have added a built-in LSP client while other editors such as Emacs,[4] vim,[5] and Sublime Text[6] have support for an LSP Client via a separate plug-in.

History

[edit]

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)[7] was based on LEXX and ran on VM/CMS, OS/2, OS/400, Windows, and Java[8]

Although the initial public release of vim was in 1991, the syntax highlighting feature was not introduced until version 5.0 in 1998.[9][better source needed]

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

In 2015, Microsoft released Visual Studio Code as a lightweight and cross-platform alternative to their Visual Studio IDE.[11] In 2016, Visual Studio Code became the Microsoft product using the Language Server Protocol.[1]

Comparison with IDEs

[edit]

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

Notable examples

[edit]

Controversy

[edit]

Many source-code editors and IDEs have been involved in ongoing user arguments, sometimes referred to jovially as "holy wars" by the programming community.[14][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

[edit]

References

[edit]
  1. ^ a b Krill, Paul (27 June 2016). "Microsoft-backed Language Server Protocol strives for language, tools interoperability". InfoWorld. Retrieved 19 June 2022.
  2. ^ "LSP documentation - Neovim". neovim.io. Retrieved 19 June 2022.
  3. ^ Shubham, Yadav. "Language Server Protocol Support in Brackets · adobe/brackets Wiki". GitHub. Retrieved 19 June 2022.
  4. ^ "LSP Mode - Language Server Protocol support for Emacs - LSP Mode - LSP support for Emacs". emacs-lsp.github.io. Retrieved 19 June 2022.
  5. ^ Devlieghere, Jonas (22 April 2018). "Using LSP & clangd in Vim". Jonas Devlieghere. Retrieved 19 June 2022.
  6. ^ "Home - Sublime Text Language Server Protocol Documentation". lsp.readthedocs.io. Archived from the original on 12 June 2022. Retrieved 19 June 2022.
  7. ^ "LPEX Editor's User Guide - Version 4" (PDF). IBM. Retrieved 19 June 2022.
  8. ^ Mike Cowlishaw FREng BSc CEng FIET FBCS CITP, IBM, archived from the original on 2006-10-18, retrieved June 20, 2022
  9. ^ "The History of Vim". Jovica Ilic. 5 June 2014.
  10. ^ Orin, Andy (18 June 2015). "Behind The App: The Story Of Notepad++". Lifehacker Australia. Retrieved 17 June 2022.
  11. ^ Somasegar, S (4 July 2015). "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". blogs.msdn.com/. Microsoft. Archived from the original on 4 July 2015. Retrieved 17 June 2022.
  12. ^ Petreley, Nicholas (11 Feb 2003). "Java text editing software for Linux". Computer World. Retrieved 17 June 2022.
  13. ^ a b c d e f "Global Text Editor Market By Product Type (Cloud Based, Web Based) And By End-Users/Application (Large Enterprises, SMEs) Global Market Share, Forecast Data, In-Depth Analysis, And Detailed Overview, and Forecast, 2013–2026". The major players operating into Text Editor Market include: Visual Studio Code, Notepad++, Sublime, Brackets, UltraEdit, Atom
  14. ^ "Holy War (Hacker Jargon)". Archived from the original on 2012-04-02. Retrieved 2016-11-30.