To use this website fully, you first need to accept the use of cookies. By agreeing to the use of cookies you consent to the use of functional cookies. For more information read this page.

Programming fundamentals tutorialWhat programming is

Computer programming is becoming a much bigger industry and is growing year upon year. It's become an important part of modern life and it's a skill that can be considered essential.

Computer programs

In a programming language, source code is a series of tokens (symbols and words). These tokens are then translated to code that computers can understand known as machine code. When the source code is translated it is called a computer program.

A program can either be interpreted or compiled. Compiled code is code that is translated into machine code and no longer contains the high level source code that was originally used to create the program. Interpreted source code is code that is compiled line by line so that it can either be debugged or stopped at a certain location in the code.

Some programming languages (including the ZPE/YASS language) use JIT or Just-In-Time compiling whereby they compile the code to interpret it straight away, often to an another language or byte-code/ op-code. This is becoming more and more favourable as computers get faster and faster and programs become less demanding. For instance, the PHP server side web development language use a form of JIT to compile code and execute it immediately.

If you are interested in seeing how a program works, you may be interested in my own ZPE programming environment as well as the YASS language that comes with it as ZPE is designed with education in mind and has many tools that will help you to see how code is transformed.

Syntax and semantics

Programming is the art of writting beautiful, syntactically and semantically accurate code that a computer can understand.

In regards to language, syntax is the arrangement in which words (or in programming contexts, tokens) follow. With this syntax we can form a formal language which consists of statements.

In contrast, semantics is concerned with the meaning of the arrangement words. If a statement has good syntax, it does not neccessarily have good semantics.

Because of semantics, a compiler can turn a bunch of tokens into something that it can act upon, e.g. some byte-codes. If tokens are arranged in a specific way, they will always be interpreted to the same underlying meaning.

A girl had one grandmother named Jane.

This statement could be interpreted as either:

  • a girl had a single grandmother whose name was Jane
  • a girl had multiple grandmothers, but only one called Jane