Skip to content

Instantly share code, notes, and snippets.

@k00ka
Created April 30, 2015 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save k00ka/e2f24ac22610abc8a994 to your computer and use it in GitHub Desktop.
Save k00ka/e2f24ac22610abc8a994 to your computer and use it in GitHub Desktop.
There are hundreds of different computer languages. Most experienced programmers know a dozen or so. To understand computer languages we have to know the beginning:
Machine Language : these are the actual instructions, one for one, executed by the computer. They are simply binary numbers, sometimes called steps, that look like this:
1 110010110011
2 111000101010
3 111101010110
In the beginnings of programming they were toggled in, one by one using switches on the front of the computer with each switch representing a 1 or 0. Once entered the sequence could be executed all at once by pressing a button on the computer console. Programming languages were invented because Machine Language is difficult for humans to understand but it is the only language that any computer can actually execute, all other languages must be always somehow translated to Machine Language. Each kind of CPU chip like Intel or IBM has a different machine language.
Computer Language: A computer language is designed to be more compatible with human cognition and problem solving than the machine language. The language is written as plain text with each sentence typically occupying it's own line of text like the following four lines:
1 if (b != 0) {
2 a=2/b;
3 if (a<0) a=0;
4 }
Computer languages come in three types Compiled Languages, Intermediate Languages, and Interpreted Languages see below.
Compiled Language : A compiled language is a language that is converted by a program, called a compiler, into machine language before the program executes. Languages like Assembler, C, C++, Pascal, Fortran, COBOL, C#, Java and many others are compiled, usually directly to machine code and kept as a file on the computer to be executed when needed. Some compilers compile to an intermediate language such as C# and Java and then compiled into machine code as with C# or interpreted. Remember machine language can only run on the machine it is compiled for, so a program compiled this way for Intel processors cannot run on IBM processors etc.
Intermediate Language : an intermediate language is the result of compiling some languages but not directly to Machine Code. The advantage is that the output of the compile, the Intermediate language, is portable across machine types. An example of the intermediate language is the CLR for C# or byte code as with Java. One can write a java program that runs on any computer since the byte-code is interpreted by a program JVM written for the specific machine.
Interpreted Languages : an interpreted language is a language that is read in by another program that executes the program instructions. The program doing the interpretation is sometimes called a Virtual Machine or VM as in the JVM for Java. Examples of interpreted languages that have no compilers i.e., no intermediate language, are JavaScript, Rexx, Perl, Ruby, PHP, etc. Interpreted languages are generally portable as long as you have the interpreter or VM to run them.
A Word about State: A computer program can "save" information in the computer's memory. For example, a number that the program is totalling, but the information can be anything even a name like "Dave". This information in memory is in addition to the machine language instructions, steps, talked about earlier. Because the saved information can change as the computer executes the program's instructions, the information at any given step in the program is called the state.
Procedural versus Object Oriented Languages: The model used by programmers to solve problems started to change during the 1980s. The earlier model is called procedural programming where the problem is divided up into smaller chunks kind of like paragraphs in an essay. The model shifted toward a more advanced way of modeling the world called object oriented programming, OOP. In OOP, state and the programming statements the deal with it are grouped together. Many procedural programmers had trouble making the transition to Object Oriented thinking which is not as easy to learn as procedural. In my experience only about 20% or less of programmers are able to think in an object oriented style of problem solving. The importance of OOP is that information can be hidden. The technique of information hiding makes it practical to write, maintain, and expand much larger programming systems than possible with other models.
Functional versus Imperative programming; Functional programming comes from a mathematical framework in computer science, lambda calculus, that was developed to investigate computability way back before digital computers physically existed. In functional programming, there is no state kept in the computer code as with imperative programming. Everything is a function, even mathematical operators like addition and subtraction can be functions. This results in yet another very different kind of "thinking" when it comes to solving programming problems. Common Lisp developed in 1956 is still widely used and is an example of a functional language and is the second oldest programming language after Fortran. Some modern imperative languages have recently incorporated ideas from functional programming including Java 8, C#, and VB.NET.
Some Important Languages but by no means all of them:
Assembler is like Machine Language but easier to read and used and can be compiled into machine language. Assembler is still used by programmers involved in building the operating system for computers or engineers interested in the highest performance such as with game graphics. It is possible to write object oriented programs in assembler. You can do anything in assembler.
COBOL is a very old procedural language, archaic, relatively verbose compared to modern language. Even so, most of the worlds business transactions still run as COBOL programs.
Fortran is a very old procedural language, archaic, is a scientific language. There are still a large number of important applications that run as Fortran dealing with weather, seismic surveys, etc.
C is a procedural language, is one of the most important breakthroughs in languages because it's compiler was written to be easily portable between machine architectures. Most operating systems are written mostly in C for this reason. Linux is written in C.
C++ is an early object oriented language and is used today when performance is important such as in high speed trading algorithms, operating systems, and some scientific programs.
Objective C: is an object oriented language use mostly by Apple and its IOS in iPhones, Ipads etc.
Java is a very important object oriented language used to build all kinds of business applications, cell phone apps, and the back end server code for websites. Java has become ubiquitous in business enterprise applications and is often mentioned as the modern COBOL.
C#: is Microsoft's object oriented language along with VB.NET. both of which are an alternative to Java.
Ruby is a derivative of Smalltalk and Perl. Smalltalk provides the basis for Ruby's object-orientation. Perl provides much of the syntax and semantics. Ruby is mainly used to build websites, but can be used for scripting or any kind of application. JRuby allows for the execution of Ruby source on any device supporting a JVM.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment