Programming Languages For Beginners

In the last post we discussed the topic of algorithms. That was fun and all, but how do we turn them into useful programs? That is where programming languages come in. The goal of this post is to serve as a broad overview of programming languages for beginners to get their feet wet.

Beginners often wonder which programming language they should learn first. While there are some choices that are objectively better than others, any general purpose programming language will have concepts applicable to other languages. Having a solid grasp of those fundamentals will be very helpful in any programmer’s journey.

We’ll be covering three sub-topics in this overview programming languages: generations of programming languages, paradigms of programming languages, and execution types of programming languages.

Generations of Programming Languages

As more great minds entered the fields of engineering and technology, they developed more advanced programming languages. With today’s modern programming languages, powerful capabilities can be unleashed with just a few text commands.

However, this wasn’t always the case. Modern programming languages have evolved from their earlier predecessors which were much more difficult to use and understand. Let’s discuss them one by one.

Machine Language (1st Generation)

Computers can only read one language: machine language. This is true even today when using modern programming languages. The difference is that modern programming languages provide extremely useful abstractions that prevent us from having to write machine language.

Machine Language
Machine Language

Machine language is represented in binary, or in other words, ones and zeros. We touched on this topic a bit in my post about basic computer literacy. Fortunately, we rarely have to deal directly with machine language these days. We are standing on the shoulders of giants.

Assembly Language (2nd Generation)

Next came assembly language, which is a huge step up from machine language. Instead of writing ones and zeros, we have the luxury of using text to tell the computer what to do. This allows us to give instructions in a way that is much more natural for human brains, and let a program called an assembler translate the instructions into machine language.

Assembly Language
Assembly Language

Unfortunately, we are still limited by the fact that in assembly language, one assembly code instruction translates to one machine instruction. This is makes for tedious work, despite the obvious advantages over machine language.

Unlike machine language, assembly language is still used directly today. Low-level embedded systems, device drivers, and real-time systems are often programmed in assembly language. Assembly language gives the programmer greater direct control over the machine instructions, which can be useful when optimizing for performance or working with hardware.

Structured Programming Language / High-Level Language (3rd Generation)

Eventually, people started creating higher-level languages. These people saw the ideas of assembly language and took them one step further. These high-level programming languages still use words instead of binary numbers, but one high-level instruction may translate into many machine instructions. Structured programming concepts are built into these languages by default.

Java, a structured, high-level programming language.
Java, a structured, high-level programming language.

This all provides a huge boost to programmer productivity, as it allows the programmers to focus more on what they want the computer to do, and not on how the computer performs the task. These languages are much more beginner friendly than assembly language.

A computer cannot execute high-level code directly. Instead, we must compile or interpret the code. More on that in a moment.

Most of the popular and recognizable programming languages in use today fall into this category. This includes languages like C, C++, C#, Java, Go, Ruby, JavaScript, and many more.

Domain Specific Programming Language (4th Generation)

Finally, we have domain specific programming languages. A domain specific programming language is a high-level language created specifically for solving a certain kind of problem.

A couple of examples include CSS and SQL. We use CSS specifically for adding style to web pages, and we use SQL specifically for interacting with databases.

SQL, a domain specific programming language
SQL, a domain specific programming language

Another example would be JSON, which is just a subset of JavaScript that’s commonly used for sending object data over the internet via HTTP.

These languages make it very easy to solve problems within their domain, but they are not very useful for solving problems outside of their domain.

Complex software, like web applications, often use a mix of both high-level languages and domain specific languages to solve problems.

Now let’s move on to our second topic: paradigms of programming languages.

Paradigms of Programming Languages

There are many different high-level programming languages, and each one has its own unique flavor. There are several different programming paradigms that languages can use. Procedural, object oriented, and functional are three of the most popular paradigms.

While we can neatly define these paradigms, the programming languages themselves often borrow ideas from all of them.

For example, while Java was clearly designed as an object oriented programming language, recent versions contain more functional concepts, like lambda expressions. It’s beneficial to become familiar with many programming paradigms in order to become a well rounded developer.

Procedural

This is the traditional method of programming, and is conceptually the most straightforward. It simply involves giving a sequence of instructions to solve a particular problem. The programmer places his/her focus on the algorithm itself. A few examples of programming languages that lean heavily on this paradigm include COBOL, Pascal, and C.

Object Oriented

In the object oriented paradigm, we organize our code into “objects”. An object is basically data and tasks you can perform with that data. We write programs in terms of how the different objects interact with each other.

This is a powerful paradigm because it allows us to model the real world and break up large problems into smaller, encapsulated problems.

Object oriented programming concepts
Concepts of object oriented programming (OOP). You could spend a long time studying this subject alone.

Much of programming involves creating abstractions that make our lives easier, and object oriented programming assists in that regard. A few examples of programming languages that lean heavily on this paradigm include Java, C#, and C++.

Functional

The functional paradigm is a declarative style of programming that treats computation as the evaluation of mathematical functions. It avoids changing state and mutable data. I have to admit, I’m much less adept with functional programming than the other two paradigms.

While academia tends to get excited about functional programming, object oriented programming is much more common in the business world.

However, functional programming has many advantages and can be an extremely powerful tool in the right hands. It often makes programs less complex and easier to reason about.

Languages often borrow from functional concepts without forcing you to embrace pure functional programming in its entirety. The idea of “passing a function to a function” alone is a great tool to have on your tool belt.

A few examples of programming languages that lean heavily on this paradigm include Haskell, Lisp, and Erlang. I’d love to hear about your experiences with functional programming in the comments, especially if you have any tips for helping others think in that paradigm.

With that section wrapped up, let’s move on to our final topic: execution types of programming languages.

Execution Types of Programming Languages

There are three main execution types of programming languages. A program can be compiled, interpreted, or ran on a virtual machine.

Compiled Languages

In compiled languages, a program called a compiler creates an executable file that runs directly on the machine. This executable contains machine code, so the original source code is no longer necessary once the executable has been created. Because of this, compiled programs usually run pretty fast. An example of a compiled language is C or C++.

Interpreted Languages

In interpreted languages, a program called an interpreter reads the code, follows along, and does what it says. We need the source code every time the program is ran, and we don’t create an executable.

Interpreted programs are usually slower than compiled programs. JavaScript, the language I’ve been using recently in my game tutorials, is an example of an interpreted language.

Virtual Machine

A language designed for a virtual machine is like a cross between a compiled and interpreted language. We compile the program, but into something called “byte code”, not machine code. The virtual machine then acts as the interpreter for the byte code.

These programs are usually slower than machine code, but faster than interpreted programs.

A couple of examples of languages that run on a virtual machine include Java and C#. In Java, the virtual machine is called the JVM (Java Virtual Machine). In C#, the virtual machine is called the CLR (Common Language Runtime).

Summary

As a beginner, the sheer number of programming languages out there can be overwhelming. It can make it difficult to know where to begin learning.

Fortunately, there are some ways of categorizing programming languages that allow us to move past all the cruft and focus on the fundamentals.

As years have gone by programming languages have become faster, easier to work with, and more powerful. Yet COBOL, an unfashionable language which first appeared in 1959, still accounts for more than 70 percent of the business transactions that take place in the world today.

This just goes to show that the business world prizes working software above all else, and a professional programmer is likely to encounter all different kinds of programming languages throughout his/her career. It helps to understand how these different languages have evolved and what capabilities they offer. Doing so will prepare you to learn whatever hot new language comes along next.

Thanks for reading as always, and don’t forget to subscribe!

2 Replies to “Programming Languages For Beginners”

Comments are closed.