Michael Sokol

Software engineer's take on programing languages and paradigms. Talks about my open-source projects.
~ Tuesday, November 22 ~
Permalink

What is code anyway?

Yesterday, I wrote about literate programing. But why should we care about it? What is code anyway?

As mighty as it might sound, code isn’t much. By itself, code is merely some characters typed in a text file. IDEs might make it look special, with all the syntax highlighting and the auto-completions, but it’s just plain old data.

Without the proper tools, source code wouldn’t even create programs. It’s because we have interpreters or compilers that our source code makes sense. It’s these tools that create a program out of code. Yet is it necessary to know how these tools operate in order to know how to code? Of course not. Why?

Because programing languages are formal. There can’t be any ambiguity when we express ideas with them (most of the time at least.)

Writing a source file in a programing language isn’t telling the machine how to do something at the low-level (which register has to be used, etc.) but what to do using the abstraction provided by the language.

In other words, writing code is writing specification for the software. Code tells the system what to do, not how to do it. For this reason, code doesn’t limit itself to machines, but can be used to communicate with anything that understands it.

While writing code, you don’t need to care if it’s going to be compiled or interpreted. This is something your tools will impose. The only thing you can do is telling which instruction, in which order, you want the system to execute.

So why are these things important? Because the main audience for code isn’t machines. It’s us. To machines, code isn’t even executable, they need to analyze it and transform it into something completely different before it can either be compiled or interpreted. It’s important to keep in mind that we are writing for other people, not for computers.


 ()