How the Internet Works 7 – Clients and Servers

Part of my goal with this series of posts it to demystify a lot of the jargon that you find when people talk about the internet. Each of these topics has a whole literature and special part of the internet dedicated to it, but just knowing what the general idea is a step in the right direction.

Today, I want to write about “clients” and “servers.” These are words that are used a lot in describing basic parts of the internet, so here is the answer:

The definitions go hand in hand, and so that is why I will introduce them together.

The client is someone that requests information server. The server is the one who responds to the requests.

If you think about it like a restaurant–when you go, you sit down at your table. You are the “client,” you can order whatever food you like. The waiter or waitress is your “server,” they respond to your requests.

In terms of the internet, you are the client. When you want to visit a webpage, say google.com, you make a request to get their webpage, and one of Google’s servers responds with the webpage.

When people talk about servers they can mean a million different things, but usually they are referring to some computer, (or part of a computer), that is responsible for “serving” up their website, or responding to the different clients who are requesting it.

“Client” and “server” go hand in hand with another pair of words: “front-end” and “back-end.” Front-end is the client-side, or the place where you, the end-user, is. Back-end is the server-side, where the website’s big computers and data-centers are. Now if I told you that “php is a server-side programming language”–you can start to decode that phrase.

How the Internet Works 6 – Programming Languages

This is going to be an extremely brief and high level overview of what a programming language is. My goal here is that if you don’t know what a programming language is before reading this, you have an idea of what it is after.

A programming language is just the way that you tell a computer what you want it to do. You run programs on your computer, like a web browser, or maybe iTunes. These are programs. Someone or a group of people built these programs, and the way they did it was by using a programming language.

There is a famous first program that people write, called “Hello World” where you just try and get the program to print out “Hello World.” Here is an example in a programming language called C:

#include <stdio.h>

int main(){
    printf("Hello World");
}

Theres a lot of random stuff here, a lot of random syntax to get the program to run, but the basic idea is that this will output “Hello World” when you run it.

In another programming language called python, if you want to print hello world you just write:

print "Hello World"

Different programming languages have different ways of telling the computer to do things. Many math operations also carry over, so for example you could add two numbers in python with:

print 5 + 10

There is wayyyyyyyyyyy more to programming languages. There is a specific legal way to write things in programming languages, and that is called the syntax. There are lots of other ways to classify and talk about programming languages, but that is for another time.

How the Internet Works 5: Bits and Binary

Theres a lot more to how the internet works, but for a few posts I want to talk about a few side topics which sort of underly everything about computers and the internet. The topic for this post is binary and bits.

So the first question is, what is binary? Binary is a base 2 number system. That might sound confusing at first, so I’ll try and compare it to a few examples you may be familiar with.

Take the number 2537. Two-thousand, five hundred, and thirty-seven. What that really means is two “thousands,” five “hundreds,” three “tens,” and seven “ones.” Our normal number system is in base-10, or decimal. What that really means is that each place stands for a power of ten. So “ones” is 10^0, “tens” is 10^1, etc.

When we talk about base-2, instead of our places standing for powers of 10, they stand for powers of two. So instead of “ones,” “tens,” and “hundreds,” we have “ones,” “twos,” and “fours.” “ones” is 2^0, “twos” is 2^1, “fours” is 2^2. (The notation X^Y means X to the power Y, so 2^3 is 2*2*2.)

If you look at the base-2 number 1011, what we have is a 1 in the “eights” place, a one in the “twos” place and a one in the “ones” place. Adding that up we get 8+2+1 = 11. The thing about binary is you only have ones or zeros, which is very easy for a computer to represent–it’s kind of like on and off.

One binary digit, a “one” or a “zero” is called a bit. Basically computers store everything in bits. All information is somehow represented in bits. It’s kinda crazy, but that’s what it is. So now you know.