Is a web page a program?

Is a web page a program? cover image
  1. Home
  2. Answers
  3. Is a web page a program?

I was wondering if a web page is a program. If so, what programming language is used for development? Or are all web page simple documents?
Many Chung

I love your questions. They might seem very basic but I can assure you the answers are not! That said, I’m going to provide a detailed explanation, without much technical jargon, which I hope would clear the doubts in your mind.

But before we delve into that, let us first define what a web page is. To keep things simple, a web page is the document that’s displayed in a web browser.

Sponsored Links

Which language is used to create web pages?

Traditionally web pages were created using the HyperText Markup Language. Though HTML is a computer language, it is NOT a programming language in the strict sense. Why? Because it lacks the basic elements of one (we’ll come to this in a moment).

The main job of HTML is to define the various parts of a document and this is done through tags. For instance, a few words of the previous sentence were put in bold using the HTML <strong> tag. Similarly, if one has to designate a paragraph or a heading in a document, one would use the <p> and <h1> tags, respectively. A document can be formatted completely using just HTML tags. Page elements like tables, subheadings, ordered and unordered lists etc. can all be defined with HTML.

Most HTML tags come in pairs – an opening and a closing tag. After all, when you are putting something in bold, for instance, you would have to specify the beginning and the end, right? There are a few tags that don’t have to be “closed”. A good example of this is the <img> (image) tag by which one can embed an image on a web page.

Following is a simple paragraph with HTML code:

<p><b>HTML</b> is <i>NOT</i> a programming language.</p>

This is displayed as:

HTML is NOT a programming language.

The eagle-eyed would have noticed that the closing HTML tag has forward slash. The <b> tag bolds the text it surrounds while <i> put text it italics. Also, the whole sentence is defined as a paragraph with the <p> tag.

In addition to HTML, web pages may contain JavaScript which IS a programming language. JavaScript runs in the web browser, the program with which you view web pages. Hence, it’s called a client-side language. Interactive pages that respond to user action, games etc. are all developed using JavaScript.

Nowadays, it is common to create web pages using server-side programming languages. For instance, the text of this very page is stored in a database and is displayed in your web browser by PHP which is a popular server-side language powering sites like Facebook! To know more, read about the differences between client side and server side programming languages.

Is a web page a program?

As you would have gathered, the question whether a web page is a program or not depends on how it has been created and what it contains. Thus, if a page has embedded JavaScript, it most definitely can be considered a program as long as it offers some interactivity.

And what about those pages that were actually server-side programs but show up in a browser as “normal” web pages? A good example of such this is the Google search engine results page. Open up the Google web site, type in a query and hit the “Search” button. Your query is processed by the Google’s search program which digs out the results from a database. Should the resultant web page be considered a program? Again, as long as it doesn’t have embedded client-side scripts (JavaScript code), I wouldn’t consider it a one.

To conclude, if a web page as displayed in a browser has only HTML, it should not be thought of as a program. However, if it has JavaScript (or other client-side language code) which brings the page to life, as it were, you can consider it a program.

Answers Basics Web Development