Beginner’s Guide to Web Development

View All Chapters
Badge server side languages

Server-side Languages

6 minute read

Why We Need Server-side Languages

Websites require two key components to function: a client and a web server. Clients, as we’ve learned, are any web browser or device that’s used to view and interact with a website. All of the files and data associated with displaying a website on a client are stored on a web server.

If you’ve ever purchased something online, many of the processes necessary to complete a transaction happen on the shop’s web server. Shopping sites need things like user accounts, up-to-date inventories, product descriptions, the ability to receive shipping and credit card information, and a place for shoppers to review products they’ve purchased. This information is stored in large databases on web servers, away from users’ web browsers.

In order to display products on the screen, you would need a programming language that runs on a server. Such a programming language would take care of creating, reading, updating, and deleting products from a database, which is where the products are stored. Languages that do this are referred to as server-side languages.

The Shopping Process

To understand some of the functions that server-side languages are able to perform, let’s take a closer look at the purchasing process in an online store.

After you’ve filled your shopping cart and are ready to check out, most shopping sites first prompt you to create or log in to an existing account before you can complete your purchase. When you enter your username and password on the login page, the information you enter is sent to a web server to be validated. Server-side languages are used to compare the login information you provided with their database of existing users, and either confirm or deny that the login information you entered is correct.

By requiring users to log in before they make a purchase, shopping sites are able to enhance the user experience by remembering things like shipping and credit card information to help save time at checkout. These types of information are stored alongside login credentials in the same large databases on the web server.

After you’ve made a purchase and received your product in the mail, you may decide that you’d like to leave a product review for future shoppers. Product reviews rely on similar server-side processes to require a user to log in to their account before reviewing a product and also making sure product reviews are posted to the correct product page.

Server-side languages are an integral part of both the online shopping experience and the entire web. Web servers provide a “central hub” where not only HTML documents are stored, but also the processes required to store, manipulate, and distribute data in real time as users interact with a site.

Which Language Do I Start With?

As mentioned previously, most server-side languages provide very similar functionality and are all capable of producing an almost identical end product. While each language has its quirks, we recommend picking a language that sounds interesting and sticking with it rather than trying to find the “best” first language to learn. As you begin to understand the logic employed by one server-side language, you’ll be able to use that knowledge to learn other languages and other styles of solving the same types of problems.

Frameworks

Many of the processes performed by a web server can get repetitive. After all, server-side applications are often designed to handle similar requests from thousands of users at a time. To alleviate some of the burden of writing unique code for every task a server-side language must perform, developers began creating something called frameworks. Frameworks provide a type of programming shorthand for common, repetitive tasks. Instead of spending time coding functionality from scratch, frameworks make developing applications easier by shortening development time, as well as offering standards and conventions that entire development teams can get behind.

Frameworks are like buying a box of cake mix at the store instead of measuring out and combining all of the individual ingredients necessary to make a cake.

Frameworks in an Online Shop

In keeping with our online shopping example, as databases of products or user accounts on an online store grow, the need for a way to easily update these databases becomes necessary.

A common example of a framework stepping in to handle the heavy lifting of updating a database comes in the form of something called object-relational mapping (ORM). Because the code syntax used to look up a product in a database is often different than the code syntax used to actually send that product information back to a user’s web browser, frameworks provide an easy way for both syntaxes to “talk to each other.”

Frameworks are built on a language-by-language basis, meaning the code for an ORM in Ruby would look different than the code for an ORM framework in Java, but they would both perform similar functions.

ORMs are just one example of how frameworks can help speed up the process of developing server-side applications.

Popular Server-side Languages

As mentioned above, the goal of a web server is to distribute the correct HTML files to the clients requesting them, maintain databases, and validate user inputs like login credentials. Just like the variety of cars on the road are all capable of bringing you from point A to point B, server-side languages all perform the same core functions, just in varying styles, speeds, and techniques. As the web has grown, so have the number of server-side languages to choose from.

Below are a few popular server-side languages you may have heard of (presented in alphabetical order), as well as the most popular frameworks used to simplify workflows and establish development standards across teams.

C# (pronounced C-Sharp)

C# was developed by Microsoft and is typically used by businesses to manage large databases. Because of the prevalence of existing Microsoft software in businesses, C# was adopted quickly.

Associated Framework: ASP.NET

Go

Go is a programming language created by Google with performance in mind.

Google does things at an unprecedented level of scale, so instead of making existing languages adapt to their needs, they decided it would be a better idea to make a new one with scalability in mind.

Associated Frameworks: Gorilla & Revel

Java

Java is one of the oldest and most widely adopted programming languages. Originally intended to be used to develop standalone desktop applications, a team of developers found a way to use it on web servers in the early 2000s.

Associated Framework: Spring

Node.js (JavaScript)

As the popularity of JavaScript grew to add interactivity to a website’s interface, some members of the community found a way to also use it as a server-side language. Node uses the same JavaScript syntax on the web server.

Associated Frameworks: Express & Hapi

Python

Python is popular in universities to teach students their first programming languages, and it is widely used in production. Since it’s popular in academic hubs, its community thrives in writing math and science libraries.

Associated Framework: Django

PHP

Unlike other languages that had to be adapted for use on the web, PHP was designed with web development in mind from day one. Many content management systems like Wordpress are written in PHP.

Associated Frameworks: Laravel & Symfony

Ruby

Ruby touts itself as an elegant and productive programming language. Originally popular in Japan in the ’90s, Ruby grew in popularity in the rest of the world after its now renowned framework, Ruby on Rails, was added.

Associated Framework: Ruby on Rails