Home » Code & Soul » Settling the Long-Debated Discussion: Is HTML a Programming Language

Settling the Long-Debated Discussion: Is HTML a Programming Language

Settling the Long-Debated Discussion: Is HTML a Programming Language

Have you ever wondered whether HTML is a programming language? It’s a common debate among tech enthusiasts, but the answer is actually quite simple. To understand the difference between HTML and programming languages, let’s first define what a programming language is.

A programming language is a set of instructions or commands that can be executed by a computer. These instructions tell the computer what to do, and the computer follows them to perform a specific task. For example, you could use a programming language to create a game, or build an app or a website.

HTML, on the other hand, is a markup language that is used to structure content on the web. When you visit a website, the web browser reads the HTML code and uses it to display the content on the page. HTML is not a programming language because it does not have the ability to execute commands or perform operations.

However, that doesn’t mean HTML is any less important than a programming language. HTML is the backbone of the web, and without it, we wouldn’t have the websites and web apps we use every day. HTML provides the structure and formatting needed to create a visually appealing and user-friendly website.

In addition to HTML, there are many other programming languages used to build websites and web apps. Some popular examples include JavaScript, Python, PHP, and Ruby. Each of these languages has its own strengths and weaknesses, and developers choose the language that is best suited for the task at hand.

One of the main differences between HTML and programming languages is their capabilities. Programming languages can take input, perform operations, and produce an output, while HTML is used to define the structure and formatting of content on the web. For example, a programming language could be used to create a calculator that takes user input and performs calculations, while HTML would be used to define the layout and formatting of the calculator on a web page.

Let’s put it this way programming languages have the ability to interact with the computer’s hardware and perform more complex operations, such as reading and writing data to memory, performing calculations, and executing conditional logic. HTML, on the other hand, is a markup language that is primarily used for structuring and formatting content on the web.

Let’s take an example of basic HTML content we save it in a file with an extension.html

<html>
 <body>
   <i> The sum of 2 and 2 is <i>
   <b> 2 + 2 </b>
   <span>&nbsp;:4</span> 
 </body>
</html

Now, what happens when you open the file using your favorite browser?

 

 

 

 

 

 

You see when a file is loaded in a browser, the browser reads the HTML code and interprets it as instructions for how to display the content. So, anything within a <i> tag will be displayed in italics in this case (The sum of 2 and 2 is), while anything within a <b> tag will be displayed in bold, in this case:4; and an Entity &nbsp; represent a single nonbreaking space, so there is a space before:4.

In this way, HTML codes are simply interpreted by the browser to display content in the formatted way specified by the markup tags ad no fancy exception in CPU or memory management.

Let’s take another example, this time with my favorite programming language, C

#include <stdio.h>

int main()
{
   int a = 2;
   int b = 2;
   int c = a+b;
   printf("%d",c); 
   return 0;
}

When you save this code with the extension .c, compile it, and run it, the following steps will occur:

  1. Memory will be reserved for the variable a, which will hold the value 2.
  2. Similarly, memory will be reserved for variable b and hold the value 2.
  3. A sum of a + b will be performed and stored in another memory location for c.
  4. Finally, the sum will be printed to an output device.

In contrast, HTML is a markup language used for creating web pages. When you write HTML code, you use special tags to define the structure and formatting of the content on the page, such as paragraphs or headings. When a web page is loaded in a browser, the browser reads the HTML code and interprets it as instructions for how to display the content. While HTML can be used to create basic interactive elements, such as forms or buttons, it is limited in its ability to perform complex operations or interact with computer hardware, as programming languages can.

In conclusion, HTML is not a programming language, but it is an essential part of the web. It provides the structure and formatting needed to create visually appealing and user-friendly websites. While programming languages have more advanced capabilities, HTML is still a crucial tool for anyone interested in web development.

Photo by Florian Olivo on Unsplash

About

One thought on “Settling the Long-Debated Discussion: Is HTML a Programming Language

Leave a Reply

Your email address will not be published. Required fields are marked *