Enough Already... Is HTML a Programming Language?

Enough Already... Is HTML a Programming Language?

The dead horse debate is back... let's settle this.

Jul 29, 2022·

4 min read

Play this article

For reasons I can't quite comprehend, this question has spurred a 🔥heated🔥 debate on the internet for years: is HTML a programming language?

The discord on the topic seems to come back around every few years, so hopefully the following will help bring some clarity to the shouting match.

beating a dead horse

Understanding HTML

First, let's take a look at what HTML is and what it does.

HyperText Markup Language, abbreviated as HTML, is a markup language used for structuring web pages. HTML is made up of a series of elements, which are represented by tags.

For example, a paragraph element is denoted by the <p> tag, and a heading element is denoted by the <h1> tag.

You can also use HTML to add images, videos, and other multimedia content to your web page.

What Makes a Programming Language?

To determine whether or not HTML is a programming language, we first need to understand what qualifies as a programming language.

Generally, a programming language is a formal language that consists of a set of instructions that can be used to produce a desired output. These languages are used to create programs, which convert the instructions into machine code that can be understood by computers.

Based on this definition, we can say that a programming language must be able to create programs that produce a desired result.

So... Does It Qualify?

The answer is... wait for it... no. HTML is simply not a programming language. You can not write programs in HTML. You can not actually compute anything with HTML. It just doesn't work that way.

HTML is a markup language. That means it's used for formatting and structure, not for logic or computational power. You can use HTML to format and create a layout for a website, but you can't use it to add any functionality.

HTML is not a set of instructions, it is simply a set of tags and data that comprise a document meant to present information.

As I mentioned before, HTML is a markup language. This means that it is used for structuring web pages. Without the ability to compute, HTML does not qualify as a programming language.

"But..."

Some people might argue that HTML is just a different kind of programming language. While I understand that some consider it a declarative language, these arguments just don't hold enough weight.

If you compare HTML to SQL, Wolfram, or any other declarative language, it's pretty obvious which one is not like the others.

There isn't any logic in HTML and it is, for the most part, completely static—it's essentially a text document that can be parsed and processed by programming languages.

Just because something has a lot of features and tags doesn't make it a programming language.

Examples

Just to be clear, here are some examples of programming languages:

  • C++
  • Rust
  • Java

There are also scripting languages, which are slightly different because they are interpreted. That said, these could also be considered programming languages:

  • JavaScript
  • Python
  • PHP

And here are some example of a markup language:

  • HTML
  • XML

The primary difference here is structuring data vs computing it.

If you need more, check out this exhaustive list of programming languages.

TL;DR

HTML does not have a specific syntax for writing programs; it does not have a set of semantics for interpreting or compiling programs. Therefore, it is not a programming language.

Conclusion

Now, does that mean HTML is useless? Of course not! HTML is a great markup language. It's hard for me to take this stance on the subject because in no way do I support gatekeeping, and its status as a language doesn't make it less important. HTML is essential for creating websites. The fact that it's easy to learn and widely supported also makes it a great entry point for new developers.

The key takeaway is to know the purpose of the tools available to you and understand their capabilities.

Let me know in the comments where you stand on the matter.

Be sure to follow me for more like this!

Further Reading

  1. Why HTML is Not a Programming Language
  2. Difference Between Programming, Scripting, and Markup Languages
  3. Of course HTML is a programming language

Did you find this article valuable?

Support trav by becoming a sponsor. Any amount is appreciated!