One tap, two worlds
You tap Order on a food app. The button changes colour at once. A moment later, the app says "Order sent".
Two different programs did this. One runs on your phone. One runs on a computer far away.
They are often written in different languages. Today you learn why, and you write both.
Key words
| Word | What it means | Example |
|---|---|---|
| Front end | The part the user sees and touches. It runs in the browser or on the phone. | buttons, forms |
| Back end | The part that runs on a server. It holds the rules and talks to the database. | work out the price |
| Server | A computer that answers requests from other computers. | |
| Browser | The program that shows web pages, such as Chrome. | |
| Request | A message from the front end that asks the back end to do something. | |
| Database | An organised store of data that programs can search and change. | |
| Language | A set of rules for writing instructions for a computer. | |
| Data type | The kind of value, such as a whole number or text. | A price is a number |
| SQL | The language for asking a database for data. |
The cells students fill in are left blank in this preview.
Quick check: where does it run?
Have a go
Quick check: where does it run?
3 questionsYour answers are marked here and are not kept. A college account keeps every student’s marks.
The five languages in the spec
| Language | Where it runs | Often used for | Good to know |
|---|---|---|---|
| Python 3.10 or later | Server | Back end, data, scripts | Short and clear code. Many libraries |
| JavaScript | Browser and server | Front end, and back end with Node (JavaScript on a server) | The main language every browser runs |
| C# | Server, desktop, games | Back end, Windows apps, Unity games (Unity is a tool for making games) | Strict about data types. Made by Microsoft |
| PHP | Server | Websites and back ends | Built for the web. Runs a lot of older sites |
| SQL | Database | Asking for and changing data | Only for data, so you use it with another language |
The cells students fill in are left blank in this preview.
Try it: a back end in Python
def price_with_delivery(total, fee):
return total + fee
order = [8, 3, 2]
total = sum(order)
print("Total", total)
print("To pay", price_with_delivery(total, 3))
# The server does the sums. Change the order and run again.
Try it: a front end in JavaScript
<button id="go">Order</button>
<p id="msg">Nothing yet.</p>Why more than one language?
data-callouts.important.label
A browser only runs JavaScript, so the front end uses it. A server can use any language. The database speaks SQL. Choose each language for the job it does best.