Source, Machine and Object code — the Difference?

IN C++. Describe the maximum clearly, the difference between these three concepts. Examples are welcome.
March 12th 20 at 08:11
2 answers
March 12th 20 at 08:13
Source code or source text - the text on the programming language that is written by a man (usually the man). This is a plain text file (usually).

But the processors in the computer/smartphone and so on. - quite dumb devices that can only understand an extremely simple machine code.
Therefore, any program directly or indirectly transformed from the original native code and only after this is executed by computer/smartphone and so on.

Object code is an intermediate representation of the code. Still not native, but not the source. Used to build programs from several pieces (maybe in the source code written by different people and at different times).

Machine code - ready for execution. That is, just take it, nothing more. Doing a double mouse click, for example, and the program runs.

Example source code is easy:
package example

func Add(p int) int {
 return p + p

An example of the object code and native code is meaningless. What object, what machine code of this program
not intended to be read by a human.

It for you will look like gibberish.
__.PKGDEF 0 0 0 644 30328 `
go object windows 386 go1.11 X:framepointer
build id "ZKpaYf_Flzmm6jns9NJp/RbNW-F32vdlI8SgqpfEX"


And that's not all the object code, where a file.

Machine code - still a lot of gibberish, here I even put couldn't. Text editor does not pass this heap of special characters, etc.

You mentioned the chain (source - object - machine) refers to programming languages that compile to native code:

Some languages designed to be compiled into byte-code. It is neither a machine nor an object. This Is A Java/Kotlin/C#. If this code were executed directly by the processor (CPU) it could be called a machine. But it runs only through a special program.

Languages Ruby/Python/JavaScript is nothing like the native code is not generated.
March 12th 20 at 08:15
Source - source code of the program
Object - intermediate modules to build and link to native code
Machine - collected object in the executable statements

Find more questions by tags IT terminology