source code

Source code is the fundamental component of a computer program that is created by a programmer. It can be read and easily understood by a human being. When a programmer types a sequence of C language statements into Windows Notepad, for example, and saves the sequence as a text file, the text file is said to contain the source code. Source code and object code are sometimes referred to as the "before" and "after" versions of a compiled computer program. For script (non-compiled or interpreted) program languages, such as JavaScript, the terms source code and object code do not apply since there is only one form of the code.

Programmers can use a text editor, a visual programming tool or an integrated development environment (IDE) to create source code. In large program development environments, there are often management systems that help programmers separate and keep track of different states and levels of source code files. 

Here is an example of the source code for a Hello World program in C language:

/* Hello World program */


printf("Hello World");


Even a person with no background in programming can read the source code above and understand that the goal of the program is to print the words “Hello World.” In order to carry out the instructions, however, this source code must be first be translated into machine language that the computer’s processor can understand; that is the job of a special interpreter program called a compiler – in this case a C compiler. Once the source code has been compiled, the file that contains the resulting output is referred to as object code. Object code consists mainly of the numbers one and zero and cannot be easily read or understood by humans. Object code can then be “linked” to create an executable file that runs to perform the specific program function(s).

Source code can be proprietary or open. When a user installs a software suite like Microsoft Office, the source code is proprietary and Microsoft only gives the customer access to the software’s compiled executables and the associated library files that various executable files require to call program functions. When a user installs Apache OpenOffice, however, the software’s source code can be downloaded and modified. Typically, proprietary software vendors like Microsoft don’t share source code with customers for two reasons: to protect intellectual property and to prevent the customer from making changes to source code that might break the program or make it more vulnerable to attack. Open source software, on the other hand, is purposely designed with the idea that source code should be made available because the collaborative effort of many developers working to enhance the software can, presumably, help make it more robust and secure.

See also: code base, source code analysis

This was last updated in June 2016

Continue Reading About source code

Dig Deeper on SOA, XML and Web Services Development Tools



Find more PRO+ content and other member only offers, here.

Related Discussions

Margaret Rouse asks:

What's the best comment you've ever run across in source code?

4  Responses So Far

Join the Discussion



Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:


File Extensions and File Formats

Powered by: