Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

With the movie "Source Code" just coming out today, I have had to explain the meaning of the phrase to non-techies. Then I was asked why source code is called source code and couldn't really answer.

I know some of my coworkers seem to prefer referring to source code as "program text", or "program files" instead. "Program Text" makes much more sense to me than "source code", but most people seem to use the phrase "source code". Does anyone know the origins and etymology of the phrase "source code"?

share|improve this question

closed as off-topic by Robert Harvey, Corbin March, MichaelT, gnat, mattnz Sep 6 '13 at 7:21

  • This question does not appear to be about software development within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

4  
This question appears to be off-topic because it is about word etymology. english.stackexchange.com is a more appropriate venue. –  Robert Harvey Sep 5 '13 at 17:01

8 Answers 8

up vote 14 down vote accepted

Way back in the dark ages of computing, source statements were punched on cards. The computer would compile the source statements, and punch the object instructions on cards.

Back then, cards were relatively cheap and disk space was expensive. If I remember correctly, a single disk for an IBM 1130, the IBM 2315 Disk Cartridge, roughly as large as a pizza, held roughly 1 megabyte and cost $3,000 (1979) dollars.

The card decks that held the source statements were called source decks, and the card decks that held the object instructions were called object decks. The source statements were called source code.

share|improve this answer
    
So the object instructions were machine instructions, and the values punched onto the source cards by the programmers were "codes"? –  FrustratedWithFormsDesigner Apr 1 '11 at 15:50
1  
@Frustrated: It wasn't quite that primitive. :-) The source was Fortran, and the object was machine object instructions, which were passed into a linker program. The output of the linker program was loaded into memory (4 kilobytes). The operating system took up some of the memory. –  Gilbert Le Blanc Apr 1 '11 at 16:01
2  
@FrustratedWithFormsDesigner: They were both codes. The distinction was that one was human readable (source code) and the other was machine executable (object code). The execution model where source code was compiled, linked and then executed was known as compile, link, and go. It was the way that most programs ran back in the old days. A job consisted of control language followed by source code followed by data. Most applications ran as job streams that were composed of a sequence of jobs that worked together to apply transactions, produce reports, and write new master files to tape. –  bit-twiddler Apr 1 '11 at 22:17
1  
(cont) The people who were responsible for scheduling and running jobs were known as computer operators. Computer operators wrote job control language, fed the beast, hung tapes, and burst multi-part listings. That's why one often sees old photographs in which people are wearing lab coats in a computer room. The lab coat protected one's clothing from the carbon paper used in multi-part paper. Computer operators were also responsible for performing backups and applying OS updates. The modern-day system administrator role grew out of the old computer operator role. –  bit-twiddler Apr 1 '11 at 22:28
1  
@Gilbert Le Blanc, very interesting to hear it goes back all the way to punched cards! I've done some digging and found references to "source code" for punched cards as far back as 1955, see my answer. –  Hugo May 27 '11 at 16:35

How I think of it --

Code:

It is code. It's a coded language that translates human terms into machine usable instructions.

Source:

It is the source of the instructions. It is the beginning of all capability in a machine context.

share|improve this answer

It makes sense in the context of compiled binaries. Code is transformed from source to a target (e.g. an executable, or a dll library, etc). Source code is generally the original part of software created by humans, not generated by other software (although some tools do generate "source").

If you have an application you have the binary byte code of the product but you do not have the "source" of that - i.e. what it was compiled from, which is then the "source code".

The code part is because the text of the source will be encoded to machine understandable instructions.

share|improve this answer
2  
+1 - but "from source to object" is typically more accurate. There are typically several translation steps, each with source and target - for the linker, the "source" is the object code - but the normal convention is that the source code is the original source text files. "Target code" may refer to "object code", "executable code" etc depending on context. –  Steve314 Apr 1 '11 at 14:14
    
@Steve314, not necessarily. Target code can still be a readable text, but it is not a source, since it should not be edited. A good example would be a typical GNU autotools Makefile.in as a source and a generated Makefile as a target. –  SK-logic Apr 1 '11 at 14:18
    
@SK-logic - "target" != "object" - the term "object" these days most often refers to the content of files with extensions like .obj or .o. A C compiler may generate an assembler listing as its target code, but this normally wouldn't be called object code, for example. Though I would guess the terms "target" and "object" had synonymous origins - object relative to subject (as grammar jargon) being similar to target relative to source. –  Steve314 Apr 1 '11 at 14:27
    
@Steve314, that's what I'm talking about: source code does not have to produce any "object" files at att. It is a "source" simply becase there can be a "target" of some sort, that's it. –  SK-logic Apr 1 '11 at 14:31
1  
@SK-logic - oops - on second thoughts, I probably should have said "from source to target is typically more accurate". –  Steve314 Apr 1 '11 at 14:33

If you go back to punch cards, there was no text or file.

When text/files became common, the terminology didn't change and everyone probably thought we wouldn't be using text for very long.

share|improve this answer
    
I guess in this case the phrase "program instructions" might be better (more generic, less mysterious sounding to non-programmers) - if it weren't so many syllables ;) –  FrustratedWithFormsDesigner Apr 1 '11 at 14:16
    
how is the use of punch cards related to the term "source code"? –  reinierpost Apr 1 '11 at 15:06
2  
I started my career in the punch-card era. Punch-cards encoded text using Hollerith coding in much the same way that a modern computer file system encodes data in ASCII or UNICODE. There were eighty columns on a standard punch-card, which is why the standard width of a "green screen" terminal was eighty characters. A program was laid-out on a coding sheet such that each line of source code was eighty characters or less. Each line of code was punched onto a single card. –  bit-twiddler Apr 1 '11 at 22:03
    
The words "text" and "file" are as ancient and overloaded as "source" and "code", so without references, this seems wrong. Of course the stuff on a punched card is "text" in many senses. And e.g. we talk of "file folders" as paper holders for paper documents which are to be filed. Why wouldn't a deck of punch cards be called a file somewhere, e.g. when it is stored (filed) in computer memory? –  nealmcb Apr 5 '13 at 23:12

The source is the start, the code is the representation of knowledge

Source code is the entry point to the software development process. It takes a wide variety of forms depending on the media that is used. Typically, source code is human readable symbols displayed on a computer screen. It could equally be holes in punched cards, magnetic domains on a disk platter, arrangements of rods within a nanobot, or whatever.

How it is represented is not relevant.

Who or what created it is not relevant.

What is relevant is that source code is the originating point of the creative process without which you cannot re-create the rest of the chain leading to the final application.

share|improve this answer

Steve314 posted the correct answer. The etymology of the phrase traces back to the days when it was used to distinguish between human readable code (source code) from machine executable code (object code). The term was coined when we made the switch from coding directly in ones and zeros to using symbolic notation.

Assemblers were the first programs to produce object code from source code. While there is a one-to-one relationship between a line of non-macro assembly language and the machine language which it encodes, a machine cannot directly execute an assembly language program.

share|improve this answer
    
I'll give @Steve314 a chance to post a complete and separate answer before I accept this one. –  FrustratedWithFormsDesigner Apr 4 '11 at 15:53

To expand on Gilbert Le Blanc's interesting answer about the dark ages of computing when source statements (the source code) were punched on cards, around 1970:

I've found even earlier references to "source code" in the context of IBM's punched cards, dating back to the late fifties, and from a number of diverse applications using early machine processing:

share|improve this answer
    
+1 Thank you! Some actual references! –  FrustratedWithFormsDesigner May 27 '11 at 17:31

Many of the other answers deal nicely with the history of the word "source". But you ask about the phrase "source code".

"Code" has its etymological origins in legal codes. See e.g. these excerpts from code - Wiktionary

From Old French code (“system of law”), from Latin codex, later form of caudex (“the stock or stem of a tree, a board or tablet of wood smeared over with wax, on which the ancients originally wrote; hence, a book, a writing.”).

...

A body of law, sanctioned by legislation, in which the rules of law to be specifically applied by the courts are set forth in systematic form; a compilation of laws by public authority; a digest.

I'm surprised by how well that relates to the kinds of instructions that programmers write when they're coding. The parallel is even more evident given Lawrence Lessig's classic phrase "Code is Law" and his book Code and Other Laws of Cyberspace. It is about the efforts of many (e.g. via the DMCA) to control cyberspace and restrict freedoms via the source code they write, or convince the authors of various other bits of cyberspace infrastructure to write.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.