Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Source code
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Purposes == ===Estimation=== The number of lines of source code is often used as a metric when evaluating the productivity of computer programmers, the economic value of a code base, [[software development effort estimation|effort estimation]] for projects in development, and the ongoing cost of [[software maintenance]] after release.{{sfn|Foster|2014|pp=249, 274, 280, 305}} ===Communication=== Source code is also used to communicate [[algorithm]]s between people {{endash}} e.g., [[code snippets]] online or in books.<ref name=Spinellis>Spinellis, D: ''Code Reading: The Open Source Perspective''. Addison-Wesley Professional, 2003. {{ISBN|0-201-79940-5}}</ref> [[Programmer|Computer programmers]] may find it helpful to review existing source code to learn about programming techniques.<ref name=Spinellis/> The sharing of source code between developers is frequently cited as a contributing factor to the maturation of their programming skills.<ref name=Spinellis/> Some people consider source code an expressive [[Media (arts)|artistic medium]].<ref>"''Art and Computer Programming''" [http://www.onlamp.com/pub/a/onlamp/2005/06/30/artofprog.html ONLamp.com] {{Webarchive|url=https://web.archive.org/web/20180220045508/http://www.onlamp.com/pub/a/onlamp/2005/06/30/artofprog.html |date=20 February 2018 }}, (2005)</ref> Source code often contains [[comment (programming)|comment]]sโblocks of text marked for the compiler to ignore. This content is not part of the program logic, but is instead intended to help readers understand the program.{{sfn|Kaczmarek ''et al.''|2018|p=68}} Companies often keep the source code confidential in order to hide algorithms considered a [[trade secret]]. Proprietary, secret source code and algorithms are widely used for sensitive government applications such as [[criminal justice]], which results in [[black box]] behavior with a lack of [[Transparency (behavior)|transparency]] into the algorithm's methodology. The result is avoidance of public scrutiny of issues such as bias.{{sfn|Katyal|2019|pp=1186โ1187}} ===Modification=== {{see also|Software development|Software maintenance}} Access to the source code (not just the [[object code]]) is essential to modifying it.{{sfn|Katyal|2019|p=1195}} Understanding existing code is necessary to understand how it works{{sfn|Katyal|2019|p=1195}} and before modifying it.<ref name=Offutt>{{cite web |last1=Offutt |first1=Jeff |author1-link=Jeff Offutt |title=Overview of Software Maintenance and Evolution |url=https://cs.gmu.edu/~offutt/classes/437/maintessays/maintEvolutionOverview.html |website=[[George Mason University]] Department of Computer Science |access-date=5 May 2024 |date=January 2018}}</ref> The rate of understanding depends both on the code base as well as the skill of the programmer.{{sfn|Tripathy |Naik|2014|p=296}} Experienced programmers have an easier time understanding what the code does at a high level.{{sfn|Tripathy |Naik|2014|p=297}} [[Software visualization]] is sometimes used to speed up this process.{{sfn|Tripathy |Naik|2014|pp=318-319}} Many software programmers use an [[integrated development environment]] (IDE) to improve their productivity. IDEs typically have several features built in, including a [[source-code editor]] that can alert the programmer to common errors.{{sfn|O'Regan|2022|p=375}} Modification often includes [[code refactoring]] (improving the structure without changing functionality) and restructuring (improving structure and functionality at the same time).{{Sfn|Tripathy |Naik|2014|p=94}} Nearly every change to code will introduce new bugs or unexpected [[ripple effect]]s, which require another round of fixes.<ref name=Offutt/> [[Code review]]s by other developers are often used to scrutinize new code added to a project.{{sfn|Dooley|2017|p=272}} The purpose of this phase is often to verify that the code meets style and [[maintainability]] standards and that it is a correct implementation of the [[software design]].{{sfn|O'Regan|2022|pp=18, 21}} According to some estimates, code review dramatically reduce the number of bugs persisting after [[software testing]] is complete.{{sfn|Dooley|2017|p=272}} Along with software testing that works by executing the code, [[static program analysis]] uses automated tools to detect problems with the source code. Many IDEs support code analysis tools, which might provide metrics on the clarity and maintainability of the code.{{sfn|O'Regan|2022|p=133}} [[Debuggers]] are tools that often enable programmers to step through execution while keeping track of which source code corresponds to each change of state.{{sfn|Kaczmarek ''et al.''|2018|pp=348-349}} ===Compilation and execution=== Source code files in a high-level programming language must go through a stage of preprocessing into [[machine code]] before the instructions can be carried out.{{sfn|Tracy|2021|p=121}} After being compiled, the program can be saved as an [[object file]] and the [[Loader (computing)|loader]] (part of the operating system) can take this saved file and [[execution (computing)|execute]] it as a [[process]] on the computer hardware.{{sfn|Tracy|2021|pp=122-123}} Some programming languages use an [[Interpreter (computing)|interpreter]] instead of a compiler. An interpreter converts the program into machine code at [[execution (computing)|run time]], which makes them 10 to 100 times slower than compiled programming languages.{{sfn|O'Regan|2022|p=375}}{{sfn|Sebesta|2012|p=28}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)