Category: 

What is Object Code in a Computer Program?

Article Details
  • Written By: David White
  • Edited By: Bronwyn Harris
  • Last Modified Date: 21 August 2016
  • Copyright Protected:
    2003-2016
    Conjecture Corporation
  • Print this Article
Free Widgets for your Site/Blog
Due to synthetic materials and furnishings, new homes burn about five times faster than those built 30 years ago.  more...

September 25 ,  1789 :  The US Bill of Rights was adopted.  more...

Computers are machines that run on millions of lines of code. Programmers write code in various languages, but all of this code has some basic features, no matter which language is being used. A program always has two sets of code, source code and object code. Source code is what is created beforehand, the language that the programmer uses to give instructions to the computer's compiler in order to make the program run. The result of the compiler having compiling these source code instructions is called object code.

The terms are intuitive, in that the source code is the beginning, or source, of the operation, and the object code is the desired result, or object, of the whole exercise. It is stored in files that are created by the computer's compiler and can then become the ultimate end intended by the programmer.

Once source code has been compiled into files, it can then continue on to the computer's processor, which executes the final instructions. Commonly available software applications are huge collections of object code that cannot be altered fundamentally since the source code is not included. It is like having the solution to the problem but not all the steps used to arrive at it. Changing this code without having the source code can be an exercise in frustration.

Ad

This multi-step process is needed because computers can execute only those instructions that are written in machine language. That is the ultimate result, which is executed versions of object code. So when a consumer gets a software application, that consumer is getting an executed version of source code that became machine language that was transformed into the final project.

Given the current emphasis on open-source code, more and more applications are being released with avenues into the source code. Diligent programmers and coders can access that source code, change it around to meet their needs, and then create new object code, which fulfills a purpose that may be different than that intended by the original programmers.

Ad

You might also Like

Recommended

Discuss this Article

NathanG
Post 3

@Mammmood – They’re totally different. Object code refers to the binaries created from your compiled code. Object oriented coding is a style of programming that organizes program logic into “objects” which can be easily manipulated. All programs compile down into object code, but not all source code follows an object oriented programming style.

Mammmood
Post 2

@NathanG – What’s the difference between object code and object oriented coding? Are they the same?

NathanG
Post 1

There’s no reason for anyone to mess with object code in my opinion. My first introduction to computer programming involved VBA code so I didn’t have to mess with compiled code in any way. Then I got into C and C++ and could see the resulting object files that were created from my code. It can be nice to see the compiled objects I suppose, but ultimately the only thing that matters in the end is the final executable program. Even today, when someone posts open source projects online, I prefer to download the completed binaries (the .exe files) rather than try to recompile the code in my native compiler.

Post your comments

Post Anonymously

Login

username
password
forgot password?

Register

username
password
confirm
email