Technology and the built world / Computing and digital systems / Software and programming / Programming languages / Programming language concepts

General · Edgepedia9 min read

Source code

Source code is the set of statements and instructions written by a human being in a programming language, such as C, Java, or Python, that a person familiar with the language can read and that a computer executes either directly via an interpreter or after conversion into object code by an assembler or compiler.1 • 20 It is the form in which software is authored, reviewed, measured, licensed, and legally protected, and it is distinct from the machine-readable object code into which it is typically translated.1

Key factDetail
DefinitionStatements and instructions written by a human in a programming language, comprehensible to a person familiar with that language, which may be executed by a computer either after conversion to object code or by an interpreter1 • 20
Object codeThe program's representation in machine language, typically binary, octal, or hexadecimal, comprehensible to a computer but not intended to be read by human beings1
Legal statusSource and object code are treated as two representations of the same copyrighted work; trade secret law is the most widely used protection mechanism1 • 2
Copyright scopeProtection covers the copyrightable expression in the program, not ideas, program logic, algorithms, systems, methods, concepts, or layouts3
Most studied metricsThe Chidamber and Kemerer metrics, lines of code, and cyclomatic complexity dominate research on source code measurement4
Supply chain scalePublic registries including PyPI, Maven Central, crates.io, RubyGems, npm, and NuGet serve trillions of downloads each year, growing 30% to 50% per year5
Historical releasesLandmark code, including the 1969-1972 APL\360 XM6 system (37,567 lines) and Microsoft's 86-DOS 1.00 listings, has been made publicly available for study6 • 7

Source code and object code

A program's source code is written to be read and modified by people. Object code, by contrast, is the representation of the same program in machine language, usually binary, octal, or hexadecimal coding, and is not intended to be read by human beings.1 The conversion process involves an assembler or compiler, although an interpreter may execute source code without first producing object code.1 • 20

The two forms are not independent works. The U.S. Copyright Office views source code and object code as two representations of the same work and, as a general rule, will not issue separate registrations for the two versions of the same program.1 Implementation choices vary by language: APL\360, for example, was implemented as an interpreter rather than a compiler that generated machine code, storing programs in an internal form called a codestring that corresponded directly to what the user had typed.6

Legal protection

Trade secrets and copyright. Trade secret law is the legal mechanism most widely used to protect source code. Copyright also protects the expression of a programmer's ideas in code, and truly innovative software can be patented, but these alternatives leave gaps: copyright protects the specific way a piece of code is written, not the more general idea of how the software functions, and patent protection is limited in time and often unavailable for parts of a software system. These limitations have meant that software producers rely mostly on trade secret protection.2 Article 39 of the WTO Agreement on Trade-Related Aspects of Intellectual Property Rights (TRIPS) offers protection for trade secrets.2

Under United States law, copyright protection extends to all the copyrightable expression embodied in a computer program, which the Copyright Act defines as a set of statements or instructions to be used directly or indirectly in a computer to bring about a certain result. Protection is not available for ideas, program logic, algorithms, systems, methods, concepts, or layouts.3

Registration practice. Registering a program with the U.S. Copyright Office normally involves depositing source code, and the rules accommodate confidentiality. If the code contains trade secret material, the depositor may block out those portions, provided the blocked portions represent less than fifty percent of the deposit and the remaining portions contain an appreciable amount of copyrightable expression; the Office strictly applies these redaction standards and will refuse a nonconforming deposit.8 For derivative programs, the deposit is typically the first and last twenty-five pages of source code, or fifty pages containing the new material.8

Disclosure in commerce. Source code has become an explicit subject of international trade policy. Recent bilateral trade agreements include provisions that place limitations on the power of public authorities to mandate access to source code, going further than Article 39 of TRIPS, while generally preserving exceptions that allow a regulatory body or judicial authority to require source code or an algorithm expressed in it for a specific investigation, inspection, or judicial proceeding, subject to safeguards against unauthorized disclosure.2 Access to source code can also serve procurement due diligence, letting a purchasing body assess regulatory compliance and lawfulness at a detailed level.2

Open source and the supply chain

Free and open source software licenses allow software to be freely used, modified, and shared; anyone can use it, commercially or non-commercially, subject to compliance with the license conditions. Copyleft licenses such as the GNU General Public License and the Mozilla Public License Version 2 add the obligation that distribution of the software in source code form, including modifications, must remain under the same license terms.9

The scale of source code distribution has grown into what its observers describe as critical infrastructure. Public package registries, which distribute source-linked packages for ecosystems such as Python, Java, Rust, Ruby, JavaScript, and .NET, now serve trillions of downloads each year, with download volumes growing by between 30% and 50% per year; the OpenSSF Governing Board has called for more enterprise support, saying the current funding model is no longer sustainable.5 Sonatype's 2026 State of the Software Supply Chain Report describes open source as the substrate of software delivery, pulled continuously by automated pipelines, and reports that attackers increasingly treat open source as a delivery channel rather than an afterthought, with malware campaigns optimized for developer workflows and targeting credentials, CI secrets, and build environments.10 Developers themselves have become high-value targets because they hold cloud credentials, SSH keys, npm publish tokens, and direct access to source code.11

Maintenance activity correlates with security posture in measurable ways. Aggregate supply chain research reports that repositories with no release in two years average 2.6 out of 10 on the OpenSSF Scorecard, against 4.5 for active repositories.12 In Europe, regulatory initiatives including NIS2, DORA, and the Cyber Resilience Act have been framed as converging on a single problem: securing the software supply chains underpinning the economy.13

Measuring source code quality

Source code metrics are extracted from the code itself, and their values support conclusions about the quality attributes they measure; they are considered essential components of the software measurement process.4 A systematic mapping study of the field found that the Chidamber and Kemerer (CK) metrics, along with lines of code and cyclomatic complexity, are the most studied, that fault prediction and complexity are recurrent topics of interest, and that Java benchmark systems are the most commonly measured systems in research.4

Quality is treated as a construct with multiple dimensions. One analysis frames software code quality as having three dimensions, maintainability, reliability, and functionality, and divides metrics into monotonic ones that consistently influence quality and non-monotonic ones that lack a consistent relationship; using 36,460 high-quality open-source repositories with metrics from SonarQube and CK, the authors proposed a distribution-based method for scoring both kinds.14 Static analysis tools are widely used in practice: SonarQube, which classifies issues as code smells, bugs, and vulnerabilities affecting maintainability, reliability, and security, is described as the most widely used such tool in both academia and industry, and a longitudinal study of 57 open-source Python projects, each with at least six releases, used it to track how issues are composed, distributed, and evolve over time.15 Metrics are also used predictively, for example in estimating bug severity from source code metrics and static analysis findings,16 though research on source code metrics as features for defect prediction models reports contrasting results about their applicability.17

Historical source code as a record

Because source code records how a system actually worked, preserved code has become an object of historical study. The Computer History Museum's Historical Source Code series has released, with permission, landmark code including MacPaint and QuickDraw, Adobe Photoshop, Apple II DOS, early MS-DOS, Microsoft Word for Windows 1.1a, early CP/M, and the Xerox Alto.6 Its APL release covers the 1969-1972 XM6 version of APL\360, written entirely in 360 assembly language: a text file of 37,567 lines in 90 files, licensed for non-commercial use, which implemented a complete timesharing operating system together with the language and served as many as 50 simultaneous users.6

Microsoft has similarly opened chapters of its own history. In 2025 it published Tim Paterson's listings for the 86-DOS 1.00 kernel, PC-DOS 1.00 pre-release kernels and utilities, and the Microsoft BASIC-86 Compiler runtime library on GitHub; Microsoft had purchased 86-DOS from Seattle Computer Products and Paterson for a figure in the region of $75,000.7 It has also released the assembly source for its 6502 BASIC interpreter, code written by co-founder Bill Gates.18 Programming-language history is likewise traced through code and its documentation: C came into being in 1969-1973 in parallel with early Unix development, its most creative period occurring in 1972, and the first widely available description of the language appeared as The C Programming Language in 1978.19

References

  1. Compendium of U.S. Copyright Office Practices, Third Edition, sections 721.3-721.5
  2. Dorobantu, Ostmann and Hitrova, Source Code Disclosure: A Primer for Trade Negotiators, The Alan Turing Institute
  3. Computer Programs, U.S. Copyright Office
  4. Source code metrics: A systematic mapping study, Journal of Systems and Software 128 (2017) 164-197
  5. Firms pledge increased financial support for public package registries, ITPro
  6. The APL Programming Language Source Code, Computer History Museum
  7. 45 years later, earliest DOS source code transcribed from a stack of old printouts found in a garage, Tom's Hardware
  8. Circular 61: Copyright Registration of Computer Programs, U.S. Copyright Office
  9. Software Freedom Conservancy, Section 1201 2021 comment, Class 16
  10. 2026 State of the Software Supply Chain Report, Sonatype
  11. The developer device is the new supply chain attack blind spot, TechRadar
  12. FOSS Data: Open-source supply chain research
  13. Digital sovereignty has become Europe's top priority, TechRadar
  14. Software Code Quality Measurement: Implications from Metric Distributions, arXiv:2307.12082
  15. A long-term exploratory study of source code quality issues in open-source Python projects, Software Quality Journal 34 (2026)
  16. An empirical study on bug severity estimation using source code metrics and static analysis, Journal of Systems and Software
  17. Source Code Metrics for Software Defects Prediction, arXiv:2301.08022
  18. Microsoft open-sourced the original code written by the company founder, TechRadar
  19. The Development of the C Language, HOPL II (1993)
  20. Translating Java Code

Topic: Encyclopedia › Technology and the built world › Computing and digital systems › Software and programming › Programming languages › Programming language concepts

Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026 · Last review: Oct 15, 2026

Notice something wrong?

© 2026 EdgeChat AI, a subsidiary of Biostate AI. Free to use with credit under the Edgepedia Community License. Developers: read Edgepedia by API or MCP. Embed a reference card.

Report an error in this article

Source code

Pick at least one reason.