Total Pageviews

Tuesday, March 29, 2011

Source Code vs. Executable Code


In the world of programming, programmers should familiarize themselves with a number of programming terms to become effective programmers. Amongst the terms a programmer should familiarize themselves with are Source Code, Executable Code, Object Code, Assembly Language, Compiler, and Interpreter. Of the aforementioned programming terms, non-programmers often misunderstand and confuse Source Code, Executable Code, and Object Code with one another.  In some cases, non-programmers consider these three terms to mean the same thing. My goal for this commentary is to provide a description of the above-mentioned terms and how they pertain to Source Code verses Executable Code.

Let us start with Source Code. Source Code is the foundation of a program because it is the programmer’s original syntax for a computer program, which the programmer writes in certain programming language (e.g. Visual Basic). Computers do not understand Source Code. Another way to think of Source Code is to imagine a person writing a set of instructions, in their native language, for another person to execute. For this scenario, let us assume the native language is Spanish and the person who must carry out the instructions only knows English.

Next, we need a Compiler. A Compiler is a program that changes Source Code into Object Code. To add to our metaphors above, a Compiler would be like a Spanish/English translator who reads the instructions and then organizes them to an understandable format that the translator can then transform. This understandable format would be what is considered Object Code. Object Code, is the Source Code instructions after they have been collected and organized. Another option a programmer has besides a Compiler is an Interpreter. An Interpreter is program, which executes commands written in a high-level language. An interpreter translates high-level instructions into an intermediate form, which it then executes. In contrast, a compiler translates high-level instructions directly into machine language. Utilizing an Interpreter instead of a Compiler would be like having the translator carry out the instructions because the translator can read, interpret, and execute the instructions.

Once the Source Code is compiled into Object Code, the programmer would then need to convert the Object Code to Machine Language or Assembly Language. Machine Language is the lowest-level programming language, which is the only language that computers comprehend. Assembly Language is similar in construction to Machine Language but it allows programmers to utilized names instead of numbers. This conversion would be the translator rewriting the instructions in English so the person responsible for carrying out the instructions comprehends what they need to carry out.

The final step is the Executable Code, which is the code that is carried out by the computer. Executable code is like instructions, after they are translated and written in English, and then read by the person responsible for executing the instructions. Once all these stages are complete, the programmer should be able to successfully their program on the computer for which they wrote the program. In addition, the person who received the instructions from the person who spoke a completely different language should be able to successfully execute the them.

No comments:

Post a Comment