Spiegato, Home

Technology and Gadgets

What Are the Different Types of Source Code?

  • Published by Spiegato
  • 2 min read

Every programming and markup language has its own particular form of source code, sometimes referred to simply as “source.” This code consists of a description of tasks that a computer is to perform and is written and stored in a text format that a human can easily read. Some code is compiled before use, a process that transforms the source into a set of instructions in machine language. Text in a markup language such as HTML is not technically source code in the pure sense of the term but is often referred to as such. There are also different legal categories of source code with the most important division being between open and closed-source.

Each programming language uses a different syntax to represent an underlying algorithm. These differences mean that source code varies from language to language. Some languages, such as C and C++, are related and share certain elements of style and syntax.

Some conventions of programming style occur across most languages. For instance, nearly every language includes some system to denote comments, or parts of the code that are intended for human viewers rather than for processing by a compiler. This is such a common feature of source code that several styles of comment notation appear in more than one programming language.

All true source code must be run through a compiler and turned into machine language before it can be executed by a computer. In some cases, such as Python in interactive mode, this task is performed dynamically. In other cases, the compiler produces an executable file which stores the instructions in machine language for later use.

The marked-up text that makes up a large portion of the content of the Web is not technically source code. A certain similarity exists, however, as HTML and other related markup languages convey meaning and describe tasks to be performed by a computer, specifically the ways in which text and other information are to be formatted and displayed. Thus, text that has been marked up in HTML is often referred to as source code.

Legally speaking, there are two models for source ownership and distribution. Open source software is software whose code is provided, sometimes with no strings attached and sometimes under an open source license agreement that preserves some basic rights for the author. Some such agreements limit the sorts of modifications that can be performed to the source code, but some simply stipulate that credit must be given to the original author.

Closed source is the other major legal variety of source code. In this model, only an executable file is provided to a license-holder. Users are banned from attempting to decompile the executable files to reveal the underlying code. This legal model dominates the commercial software field, although some open source business models have proven to be viable as well.

Key terms in this article

Related articles

  • What is Source Code?

    Source code refers to the programming language one uses to write a program. There are hundreds, if not thousands, of programming languages, including C++…

  • What is Linux® Source Code?

    Source code is a term used to refer to the file or files containing the actual lines of programming instructions written by programmers for software they…

  • What is a Source Code Editor?

    A computer program is a software application that is built from source code. This source code is typically entered into a computer through a source code…

  • What Is a Source Code Virus?

    A source code virus is a computer virus that attacks source code to corrupt it in some way. It may render a program or operating system unusable, hijack a…

  • What Are the Different Types of Open Source QR Code Programs?

    When it comes to Quick Response (QR) codes, different types of open source QR code programs are often developed to provide a range of features. Many of…