Introduction to programming

introtoprogramming-190909184629-thumbnail-4

I have just celebrate 11 years of developing a product for a customer. One of the biggest reasons for writing programs is to solve a need. There is a whole world of different programming languages in the world but they come down to just two types.

Compiled vs Interpreted languages

Programming languages are use case specific. In a real world example, the United Nations is in session, and someone is speaking a different language. An interpreter is at hand to interpret the spoken words into a language the ambassador of that country can understand. So every time someone speaks, it is interpreted. It’s a real time thing for the interpreter. The session ends and the notes of that session is compiled into a book so each nation can read the notes in their own language without the need of the interpreter.

Compiled languages

When a program is developed, the source code is written in an editor of some sort, then when the programmer is ready to compile the program into a binary form (developing it – like a photographer would with traditional camera film) then the programmer can see if there are any compile time errors that have been made in the code.

Additionally, a progran can be written that generates no errors until it is run, these errors are called run-time errors.

The advantage of compiled langauges is that the binary version of the code runs without having to recompile it every time, this makes the code faster.

Interpreted languages

Interpreted languages are easier to debug and easier to write because the interpreter will find bugs in the code much quicker. Some editors can see a bug in the code quickly.

The downside of interpreted languages is speed, as the code you write has to be interpreted every time it runs.

Performance

When a programmer writes a program for a desktop computer, such as a word processor or a game, it has to be fast or the user will simply give up. This is also true for operating systems.

However, web development and mobile development typically has code that runs on the server that the user interacts with, so the bulk of what is written on the Internet uses interpreted languages.

Examples of compiled languages

Perhaps the most well used is C, which has an Object Oriented version called C++ as well as versions by Microsoft such as C#, and Apple’s Objective C. Fortran is an older, less used example of a compiled language.

Java is a compiled language that runs in it’s own special environment.

Examples of interpreted languages

BASIC and COBOL are early examples of interpreted languages from my youth, but before then there were APL, ALGOL, FORTH.

Perl and PHP are common interpreted languages on the web, so is Ruby.

Swift and Python are newer langauages that are more tailored for web and app development.

HTML, CSS and JavaScript are interpreted languages that are interpreted in the browser rather than the server.

Share this post with your friends