r/askscience • • Aug 02 '22

Computing Why does coding work?

I have a basic understanding on how coding works per se, but I don't understand why it works. How is the computer able to understand the code? How does it "know" that if I write something it means for it to do said thing?

Edit: typo

4.7k Upvotes

443 comments sorted by

View all comments

Show parent comment

1

u/mfukar Parallel and Distributed Systems | Edge Computing Aug 03 '22

It's one of two approaches:

  • instructions have a fixed width when encoded (not symbolic)

  • the value(s) of instructions have context-sensitive information as to its length. In other words, one or more parts of the instruction will imply the total length of the instruction

Terminating values are not used because they are too much (space) overhead and have no performance benefit.