As you are learning HTML, JavaScript and CSS, you are going to realize that there are things that webpages do, that you can’t do with HTML, JS or CSS. At that point, it is time to understand the server-side vs. client-side of the web.
All of the web development you have been doing so far, using HTML, JS and CSS, has been on the client side.
What’s a server and what’s a client?
Your (and every other websurfer’s) computer is a client. Whenever you use the internet, your computer sends a request to a distance computer that responds to your request. The computer that is responding is the server.
When you check your email, your computer sends a request to an email server which has your emails stored on it. When you watch YouTube, your computer sends a request to the YouTube server which has the video files stored on it.
How are clients and servers different?
Clients and servers are different in many different ways:
Physical structure
Because a server is usually dedicated to responding to internet requests, it often has a huge amount of storage, no screen to display information, and no keyboard to receive input.
Storage of data
Servers store data. They may store just a small amount of your information, like a password, or they may store whole emails or Google docs.
Clients typically do not store information from the web. Browsers display the information and then the data disappears, unless the user specifically tells the web browser to save some data.
Security
Both clients and servers are worried about security. Neither side wants the other side to be able to read their secret files, write data to their storage devices, or take control of their computers.
However, because of their different roles, they must manage security in different ways.
Programming languages
The code that a client runs is sent to them by the server. In some ways, the client is allowing the server to control their computer. The code that a server sends is a combination of HTML, JavaScript, and CSS, which are specifically designed to be safe. They are safe because they are limited in what they can do. The main limitation is that they cannot read or write data to or from the client’s hard drive.
The code that the server sends to the client is readable by the client. Therefore, there are no secrets in the code. If there are passwords or special algorithms, they will be visible to the client.
Because the server wants to be able to write data to its own hard drive and because the server wants to be able to keep parts of its code secret, it uses different programming languages. These languages can include C#, Python, PHP, Perl, Ruby, Go, Swift, Haskell, and many others. These are full-fledged languages that can do anything, although some are more useful for some tasks than others. But they are not limited in their ability to read and write data.
Different developers
The user interface and the user experience are known as the “front end”. The database management and the algorithm that the server uses are known as the “back end”. Often different developers work on the front end and the back end. Front end developers have to think about how the webpage will look, how it works on different devices and different browsers, and how the user will interact with the website. They often code in HTML, CSS, and JavaScript. Back end developers have to think about the structure of the database and the logic of the algorithm the business uses. They tend to code in other languages.
For further reading
Client Side vs. Server Side in Web Development: A Beginner’s Guide (fullstackfoundations.com)
Leave a comment