DEV Community

Cover image for Why HTML is Not a Programming Language?
Richard Shaju
Richard Shaju

Posted on

Why HTML is Not a Programming Language?

Understanding HTML

HTML stands for HyperText Markup Language. It's the standard language used to creUnderstanding HTML

HTML stands for HyperText Markup Language. It's the standard language used to create web pages. When you visit a website, what you see is made up of HTML. It's like the skeleton of a web page, providing the basic structure.

What HTML Does
HTML uses tags to tell the web browser how to display content. For example:

  • h1 tag is used for main headings.

  • p tag is used for paragraphs.

  • a tag is used for links.

These tags wrap around content to give it meaning and structure. They don't do any calculations or perform any actions. They just tell the browser what each part of the content is.

What is a Programming Language?

A programming language is used to write instructions that a computer can follow. These instructions can perform complex tasks like:

  • Making decisions (if this happens, do that).

  • Repeating actions (do this action 10 times).

  • Calculating and processing data (add these numbers together).

Examples of programming languages include Python, JavaScript, and C++. They can create applications, games, and more by using logic and control flow.

Key Differences

  • Structure vs. Action:
  • Static vs. Dynamic:
  • No Logic in HTML:

Working Together

  • While HTML is not a programming language, it often works alongside them. For example:
  • CSS (Cascading Style Sheets): Used with HTML to style the content (colors, fonts, layout).
  • JavaScript: Used to add interactivity (like responding to button clicks or validating forms).

Think of HTML as the building blocks of a web page, CSS as the paint and decorations, and JavaScript as the electricity that makes everything work.

Conclusion

In simple terms, HTML is like the blueprint of a house. It shows where everything goes but doesn't build the house or make things work. A programming language, on the other hand, is like the tools and machinery that actually build the house and make things function. So, while HTML is crucial for web development, itโ€™s not a programming language because it doesnโ€™t perform actions or handle logic.

Top comments (7)

Collapse
 
jonrandy profile image
Jon Randy ๐ŸŽ–๏ธ

They don't do any calculations or perform any actions

Calculations - maybe not, but it isn't really accurate to say HTML cannot perform actions:

  • Anchor tags can move you to another document, or another position in the same document
  • Submit buttons can submit a form, as can pressing return on a text field on a form
  • Clicking a summary tag will show/hide the other contained content of the enclosing details tag
  • The data in a form can be validated and submission blocked if data is invalid - just using HTML
  • etc...

If you mix in CSS, it is possible to make 3D games or even a calculator... all without JS!

But, I do agree that HTML is not a programming language ๐Ÿ‘

Collapse
 
richardshaju profile image
Richard Shaju

I appreciate your findings. I wrote this article, particularly for those new to programming, who are raising the question of whether HTML qualifies as a programming language. In my view, HTML is an advanced version of the Markdown format.

Collapse
 
jonrandy profile image
Jon Randy ๐ŸŽ–๏ธ

Probably the other way around - Markdown is like (very) simplified HTML... as it was created many, many years after HTML

Collapse
 
efpage profile image
Eckehard

I suppose, you will get in trouble, if you try to get a final answer to this question. See this talk from Dylan Beattie. Anything that makes a computer do something can be defined as a programming language. Or not.

Historically HTML is connected very closely to XLM which is clearly a data format. But HTML features some semantic elements, which you can see as kind of elements of a programming language. Or not.

I would turn thing upside down and ask: If HTML was a programming language, would I want to use it? For me it misses too much to be useful, so I tend to see HTML as a data format...

Collapse
 
richardshaju profile image
Richard Shaju

Anything that makes a computer do something can be defined as a programming language.

This is true, every software on a computer is made of a programming language, which enables the computer to perform certain tasks. The creators of this code refer to it by name. Once software is developed using this code, it can only be used to solve a specific problem.

However, we can use a programming language for various purposes. It can even be used to develop another programming language.

Also the full from of HTML is: Hyper Text Markup Language

Collapse
 
dabbler_bhai profile image
Happy Hacker

Hey bro I am beginner for programming language but I know HTML and CSS very well , if you know programming language so no please msg me

Collapse
 
richardshaju profile image
Richard Shaju

Hello, if you are confident in HTML and CSS, then you should consider learning Javascript.