Frequently Asked Questions (FAQ)
Web Basics
Here are some basic questions and answers about the web:
Use the questions below to explore each web concept in more detail.
What is the difference between the Internet and the World Wide Web?
The Internet was invented in the 1960s as a way to connect computers together so they could share information. It was originally a military project started during the Cold War, and so it was designed to be a decentralised network that could withstand a nuclear attack. That made it very robust and reliable, but it was also very complex and difficult to use. Although it allowed computers to share information at a basic level, it was not user-friendly and required a lot of technical knowledge to use.
The World Wide Web was created as a way to make the Internet more user-friendly. It was designed to be a system of interlinked hypertext documents that could be accessed via the Internet using a web browser. The World Wide Web made it much easier for people to access and share information on the Internet, and it quickly became the dominant way people used the Internet. The World Wide Web started as a way to share text dissertations and research papers among scientists, but the language used to create web pages (HTML) and the protocols used to access them (HTTP) quickly evolved to allow for more complex and interactive content.
Who invented the World Wide Web?
The World Wide Web was invented by Tim Berners-Lee in 1989 while he was working at CERN (the European Organization for Nuclear Research) in Switzerland.
He created the first web browser and web server, and he also developed the first version of HTML (Hypertext Markup Language), which is the standard language used to create web pages.
How does the web work?
The web works by using a system of interlinked hypertext documents that are accessed via the Internet.
When you click on a link, your web browser sends a request to the server that hosts the document, and the server sends the document back to your browser.
What is a web server?
A web server is a computer that stores web pages and serves them to users when they request them.
It uses HTTP (Hyper Text Transfer Protocol) to communicate with web browsers. A web server can host multiple websites and can handle many requests at the same time. Any computer can be a web server so long as it is connected to the Internet and has the necessary software installed. Usually, though, it is a powerful computer with a lot of storage space and a fast Internet connection.
What is URL?
A URL (Uniform Resource Locator) is the address of a web page and is the basic way to access resources on the web.
It specifies the location of a resource on the Internet and consists of a protocol (usually HTTP or HTTPS), a domain name, and a path to the specific page. It may also contain a query string or fragment identifier to specify additional parameters or sections of the page.
What is HTML?
HTML (Hypertext Markup Language) is the standard markup language for creating web pages. It is used to structure content on the web. The current version of HTML is HTML5, which includes features and improvements over previous versions which makes it easier to create modern, interactive web pages.
HTML uses tags to define elements on a web page, such as headings, paragraphs, links, images, and more. These tags are used to create the structure of the page and to apply styles and formatting to the content. HTML is not a programming language, but rather a markup language that describes the structure of a web page.
HTML is the backbone of web development and is used in conjunction with CSS (Cascading Style Sheets) and JavaScript to create dynamic and interactive web pages.
What is CSS?
CSS (Cascading Style Sheets) is a style sheet language used for describing the presentation of a document written in HTML. It is used to control the layout and appearance of web pages.
CSS allows developers to separate the content of a web page from its presentation, making it easier to maintain and update the design of a website. It provides a way to apply styles to HTML elements, such as colours, fonts, spacing, and positioning. CSS can be applied to a web page in several ways, including inline styles, internal style sheets, and external style sheets.
CSS is an essential part of web development and is used in conjunction with HTML and JavaScript to create visually appealing and responsive web pages.
What is JavaScript?
JavaScript is a programming language that is commonly used to create interactive effects within web browsers. It is used to add dynamic behaviour to web pages.
JavaScript can be used to manipulate HTML and CSS, allowing developers to create interactive elements such as forms, animations, and real-time updates. It is a versatile language that is an essential part of modern web development and is used in conjunction with HTML and CSS to create dynamic and interactive web applications.
What does a web browser do?
A web browser is a software application that allows users to access and view web pages. It interprets HTML, CSS, and JavaScript to display the content of a web page.
When a user enters a URL into the browser's address bar or clicks on a link, the browser sends a request to the web server that hosts the page. The server then sends the requested page back to the browser, which renders the content and displays it to the user. The browser also handles user interactions, such as clicking links, filling out forms, and navigating between pages.
Popular web browsers include Google Chrome, Mozilla Firefox, Microsoft Edge, and Apple Safari. Each browser has its own features and capabilities, but they all serve the same basic purpose of allowing users to access and interact with web content.
What is a 404 error?
A 404 error is an HTTP status code that indicates that the requested page could not be found on the server. This usually means that the page has been moved or deleted.
Whenever a browser sends a request to a server, the server responds with a status code to indicate the result of the request. A status code of 200 means that the request was successful and the page was found, while a status code of 404 means that the page could not be found.
Other common HTTP status codes include 500 (Internal Server Error), which indicates that there was a problem with the server, and 403 (Forbidden), which indicates that the user does not have permission to access the requested page.
A full list of HTTP status codes can be found on the MDN Web Docs.
What is a cookie?
A cookie is a small piece of data that is stored on the user’s computer by the web browser while browsing a website. Cookies are used to remember information about the user, such as login credentials, preferences, and shopping cart contents.
When a user visits a website, the server can send a cookie to the user’s browser, which stores it on the user’s computer. The browser then sends the cookie back to the server with each subsequent request to the same website. This allows the server to recognise the user and provide a personalised experience.
Cookies can be used for various purposes, such as tracking user behaviour, remembering user preferences, and maintaining session state. They can also be used for advertising and analytics purposes.
Cookies can be classified into two types: session cookies and persistent cookies. Session cookies are temporary and are deleted when the user closes the browser, while persistent cookies are stored on the user’s computer for a specified period of time.
What is streaming?
Traditionally when you want to download a file from the Internet, your browser sends a request to the server that hosts the file, and the server sends the entire file to your browser. This means that you have to wait until the entire file has been downloaded before you can start using it.
Streaming is a method of transmitting or receiving data over the Internet in real-time, allowing users to access and consume content without having to download it first. This is commonly used for audio and video content, such as music, movies, and live broadcasts.
Streaming works by breaking the content into small chunks and sending them over the Internet in a continuous flow. The user’s device then receives these chunks and plays them back in real-time, allowing the user to start watching or listening to the content almost immediately.
Streaming can be done using various protocols, such as HTTP Live Streaming (HLS) and Real-Time Messaging Protocol (RTMP). It requires a stable Internet connection and sufficient bandwidth to ensure smooth playback without interruptions.
What is a Search Engine?
There are a lot of web pages on the Internet - no one knows exactly how many but some estimates suggest over a billion. With that many pages, it would be impossible to remember the address of every page you want to visit. So Search Engines were invented to help you find the pages you want.
Search Engines work by creating an index of all the web pages on the Internet. They use automated programs called crawlers or spiders to visit each page and collect information about it. This information is then stored in a database, which allows the search engine to quickly find and retrieve relevant pages when a user enters a search query.
When you enter a search query into a search engine, it uses algorithms to analyse the index and return a list of relevant pages. The search engine ranks the pages based on various factors, such as the relevance of the content to the search query, the quality of the page, and the authority of the website.
Some search engines also use machine learning and artificial intelligence to improve their algorithms and provide more accurate and relevant results.
Some search engines, like Google, collect data about users' search behaviour to improve their algorithms and provide personalised results. This data can include information about the user’s location, search history, and preferences. Others focus on privacy and do not track users' search behaviour, such as DuckDuckGo.
Popular search engines include Google, Bing, and DuckDuckGo. Each search engine has its own unique algorithms and ranking factors, which can affect the results returned for a given search query.
What is SEO?
SEO (Search Engine Optimisation) is the process of improving the visibility of a website or a web page in a search engine's organic results.
With so many web pages on the Internet, it is important to make sure that your web page is easy to find. SEO is a set of techniques and best practices that can help improve a website's ranking in search engine results pages (SERPs).
SEO involves optimising various elements of a website, such as the content, structure, and metadata, to make it more relevant and appealing to search engines. This can include using relevant keywords, optimising page titles and descriptions, improving site speed and mobile-friendliness, and building high-quality backlinks.
SEO is an ongoing process that requires continuous monitoring and adjustment to keep up with changes in search engine algorithms and user behaviour. It is an essential part of digital marketing and can help drive organic traffic to a website, increase brand visibility, and improve user experience.
Web Development Basics
Here are some basic questions and answers about web development:
The questions below explain core concepts that developers use every day.
What is web development?
Web development is the process of creating and maintaining websites. It involves a combination of programming, design, and content creation.
Web development can be divided into two main categories: front-end development and back-end development. Front-end development focuses on the user interface and user experience, while back-end development focuses on the server-side of a website.
What is front-end development?
Front-end development is the part of web development that deals with the user interface and user experience.
It involves creating the layout, design, and interactivity of a website using HTML, CSS, and JavaScript.
What is back-end development?
Back-end development is the part of web development that deals with the server-side of a website.
It involves creating and managing the database, server, and application logic using programming languages like PHP, Python, Ruby, Java or C#.
What is full-stack development?
Full-stack development is the practice of working on both the front-end and back-end of a website.
A full-stack developer has the skills to work on all aspects of web development.
What is a program or algorithm?
A program is a set of instructions that a computer can execute to perform a specific task. An algorithm is a step-by-step procedure for solving a problem or accomplishing a task.
For practical purposes, a program is an implementation of an algorithm in a specific programming language. Algorithms can be expressed in many different ways, including natural language, pseudocode, or flowcharts.
What is a variable?
A variable is a named storage location in a program that can hold a value.
It can be used to store data that can be changed during the execution of the program.
What is a function?
A function is a block of code that performs a specific task.
It can take input parameters and return a value. Functions are used to organise code and make it reusable.
What is a parameter?
A parameter is a variable that is passed to a function when it is called.
It allows the function to receive input data and use it in its calculations.
What is an object?
An object is a data structure that contains properties and methods.
It is used to represent real-world entities and their behaviour in a program.
What is a method?
A method is a function that is associated with an object.
It can be used to perform actions on the object's properties or to manipulate the object itself.
What is data?
Data is information that is processed or stored by a computer.
It can be in the form of text, numbers, images, or any other type of information.
What is a data structure?
A data structure is a way of organising and storing data in a computer so that it can be accessed and modified efficiently.
Common data structures include arrays, linked lists, stacks, queues, and trees.
What is a database?
A database is an organised collection of data that can be accessed and managed using a database management system (DBMS).
It allows for efficient storage, retrieval, and manipulation of data.
What is responsive design?
Responsive design is an approach to web design that makes web pages render well on a variety of devices and window or screen sizes.
It uses fluid grids, flexible images, and CSS media queries to adapt the layout to the viewing environment.
What is accessibility?
Accessibility is the practice of making web pages usable by people with disabilities.
It involves designing and developing web content that can be accessed by all users, regardless of their abilities or disabilities.
Tips and tricks real developers use to make their lives easier
Here are some tips and tricks that real developers use to make their lives easier:
The questions below cover simple habits and tools that save time.
Make backups of your work.
Always make backups of your work to avoid losing it in case of a computer crash or other disaster. Use cloud storage or external hard drives to keep your files safe. Even if you don’t use the cloud, copy your files to another folder. Back up everything before you make changes to it - you never know when you might make a mistake and get back the original version.
If you ignore all the other tips on this page, at least remember this one. It will save you a lot of wasted time and frustration.
Use a version control tool.
Version control tools allow you to keep track of changes to your code, collaborate with others, and revert to previous versions if needed.
The most popular version control tool is Git, which is widely used in the software development industry.
Use folders to organise your files.
Organise your files into folders to make it easier to find what you need. Use descriptive names for your folders and files to help you remember what they contain.
A good example is to have four folders, one for HTML files, one for CSS files, one for JavaScript files, and one for images. This way, you can easily find the files you need when you are working on a project.
Use consistent naming conventions.
Use consistent naming conventions for your files and folders to make it easier to find what you need. Use lowercase letters and separate words with underscores or hyphens.
You won't believe how much easier it is to write programs when you use consistent naming conventions. It makes it easier to read and understand your code, and it helps you avoid mistakes.
Using consistent names doesn't just apply to files and folders, it also applies to variables, functions, classes and other code elements. For example, if you have a variable that stores a user’s name, you might call it user_name or userName. The important thing is to be consistent in your naming conventions so that you can easily understand your code.
Don't repeat yourself.
Don’t repeat yourself (DRY) is a principle of software development that states that you should not write the same code multiple times. If you find you are writing the same or similar code in multiple places, it is a sign that you need to refactor your code to make it more modular and reusable. You can do this by creating functions or classes that encapsulate the reusable code.
For example, suppose you have three buttons in your HTML that all need to respond in the same way:
You could write the event handlers for each button like this:
But this is not very DRY, because you are repeating the same code three times. Instead, you could create a function that handles the button click event and pass the button ID as a parameter:
Now you have a single function that handles the button click event, and you can easily add more buttons without repeating the same code. It may not look much better in this simple example, but in larger programs, it can make a big difference in terms of readability and maintainability.
Comment your code.
Comment your code to explain what it does and how it works. This will help you and others understand your code when you come back to it later.
A really useful comment you can add to your code is a "TODO" comment. This is a comment that reminds you to do something later, such as fix a bug or add a feature. You can use it to keep track of things you need to do in your code. In fact, many code editors and IDEs like Visual Studio have built-in support for TODO comments, which makes it easy to find and manage them.
For example, you could add a TODO comment like this:
Then, when you come back to your code later, you can search for "TODO" to find all the places where you need to make changes.
Always test everything.
Always test your code to make sure it works as expected.
Testing is an essential part of software development. It helps you catch bugs and errors before they become a problem. A good rule of thumb is If it hasn't been tested, it doesn't work.
There are many different types of testing, including unit testing, integration testing, and end-to-end testing. Each type of testing has its own purpose and can help you catch different types of bugs.
Real software developers spend more time testing their code than writing it. They know that testing is the key to delivering high-quality software that meets the needs of users.
Make sure your web page is secure so it can't be hacked.
Make sure your web page is secure to prevent unauthorised access and data breaches. Use HTTPS, validate user input, and keep your software up to date.
It is very easy to make a web page that is vulnerable to hacking. Hackers can exploit vulnerabilities in your code to gain access to your server, steal data, or even take control of your website.
Here is an example of a simple web page that is vulnerable to hacking:
This web page has a form that allows users to enter their username and password. However, it does not validate the input or use HTTPS, which makes it vulnerable to hacking.
To make this web page more secure, you could add input validation to ensure that the username and password meet certain criteria, such as length and complexity. You could also use HTTPS to encrypt the data being sent to the server.
Here is an example of a more secure web page:
This web page uses JavaScript to validate the input before submitting the form, and it also uses the "required" attribute to ensure that the user enters a value for both fields. This makes it more secure and less vulnerable to hacking.
Note that this is a good start but it is not enough to make your web page completely secure. You would also need to implement server-side validation, use prepared statements to prevent SQL injection attacks, and implement other security measures to protect your web page from hacking.