Looks like you're stuck. Need a hand?

Share This Tutorial

Views 69

BTEC Computing L3 - Coding for the Web

Date  |  Category Computer Science
...
...
Learning Paths Learning Paths

Coding for the web is its own world. You are dealing with browsers, servers, devices, protocols and security concerns that do not exist in normal desktop software. This tutorial gives you a grounded understanding of how web code works, why it behaves the way it does and the trade-offs behind client-side and server-side processing.

Mark-up languages and why they matter

The web runs on structured text. HTML, CSS and XML are all examples of mark-up languages. They describe content in a predictable way so browsers and systems know how to interpret it.

HTML handles structure and content.
CSS handles layout and presentation.
XML handles data and information exchange.

Mark-up exists to separate what something is from how it looks. A browser then translates these tags into a usable page.

Platform independence

One of the strengths of web code is that it runs on almost anything with a browser. It does not rely on a specific operating system or hardware. A phone, a laptop and a console can all load the same site because the browser does the heavy lifting.

The trade-off is that you are limited by what a browser allows. Direct access to hardware, system files or OS-level features is restricted for security reasons.

Performance constraints

Web code is not as fast as native code. Browsers add layers of interpretation, sandboxing and security checks. Some operations are slower, and network speed becomes a major bottleneck.

Front-end performance depends on: - the device’s hardware
- the browser engine
- the size of the page
- the speed of the internet connection
- how much scripting is running

Server-side performance depends on: - server power
- number of requests
- database speed
- how efficient the backend code is

Power consumption

Client-side code runs on the user’s device. More animations, scripts and rendering cost more battery life. Heavy JavaScript drains mobile devices quickly.

Server-side code uses server power instead. If the backend has to process huge requests, run encryption or generate dynamic content, it raises energy usage on the host machine instead of the user device.

Protocols and APIs

Web systems talk through defined rules known as protocols. The key one is HTTP, which handles loading pages, sending form data and moving resources across the web.

APIs allow applications to communicate by sending structured requests and responses. They enable features like login systems, payment gateways, search tools, data dashboards and integrations with other services.

Client-side processing

Client-side processing happens inside the browser using languages like JavaScript. It is used for anything that needs to react instantly without contacting the server.

Typical uses include: - form validation
- animations
- auto-complete
- live updates
- interactive UI elements

Advantages:
Fast feedback, reduced server load, smoother user experience.

Limitations:
Viewable to the user, can be copied, depends on browser compatibility, cannot handle secure operations.

Server-side processing

Server-side processing runs on the server before anything is sent to the browser. Languages include Python, PHP, Ruby, JavaScript (Node), Java and more.

It is used for: - database operations
- authentication
- encryption
- storing and retrieving data
- generating dynamic pages

Advantages:
Hidden code, secure operations, can handle heavy tasks, consistent behaviour.

Limitations:
Extra load on the server, slower responses, requires hosting, needs an active internet connection.

Advantages of implementing code on a web platform

Web platforms have several natural strengths: - no installation needed
- always up to date
- secure by design due to sandboxing
- simple integration with media and third-party services
- accessible on almost any device
- easy to link, share and embed content
- centralised control and updates

Disadvantages of implementing code on a web platform

There are trade-offs: - code is visible and easy to copy
- relies on a web browser
- often slower than native applications
- requires internet access
- hosting costs money
- exposed to hacking and defacement
- inconsistent support across browsers
- limited access to underlying hardware

Summary

Coding for the web means balancing flexibility, reach and accessibility with performance, security and platform restrictions. Choosing between client-side and server-side processing depends on the job at hand and the level of security or speed required.

A web application works best when each part is used for what it is designed to do: the browser handles interaction and presentation, while the server handles secure logic, data and heavy processing.