DEV Community

Cover image for Is HTML a Programming Language?

Is HTML a Programming Language?

Anita Olsen on December 10, 2023

I had just joined X after been learning Python syntax for a while from a code learning site and I kept coming over (I still do) some people there who claim that HTML is a programming language! That was a new one to me! What makes them say that?

Would you call HTML a programming language?

Collapse
 
ben profile image
Ben Halpern

In my opinion, absolutely yes.

It is not turing complete — but it is a specialized language for programming the most ubiquitous computer interface there is.

HTML is not very powerful if not used in conjunction with other programming languages which interface with other parts of an operating system, but all the work in HTML is programming if you ask me.

Collapse
 
manuchehr profile image
Manuchehr

Please don't say that! HTML is not a programming language. If we consider HTML is a programming language, then Markdown is programming language too?

Collapse
 
cmahte profile image
Michael H • Edited

Does Markdown have a {script} element? If it does, then ...

Thread Thread
 
manuchehr profile image
Manuchehr • Edited

So let's rename HTML -> HTPL (Hyper Text Programming Language lol)
The creators of HTML are much more wise than you.

Collapse
 
efpage profile image
Eckehard

Ok, but then we have to state that ASCII is a programming language too. With ASCII, you can tell the computer to do some lyrics, and we learned that anything that tells a computer do do something is a programming language. Ok, ASCII is not very powerful. It contains 256 commands and each can just prints out one character, no loops, no conditionals.

Finally, it comes out, Shakespere was a programmer. I really like the codes he wrote. You should definitively check out The Art of Code, which adds a lot of interesting aspects to this discussion.

Collapse
 
beastful profile image
Ilya Afendin

I like your answer
Most people here just think that Imperative programming is the only way of writing a program )

Collapse
 
abhilearnstocode profile image
Abhii

Short answer: No!

Long answer: HTML (short for Hyper Text Markup Language) is used to structure a webpage which is not same as programming a software. To program a software, we need to add logic to it and HTML does not have ability to add logic. To add logic to webpages we use a wonderful language JavaScript. So.... HTML is not a programming language.

Image description

Collapse
 
cdoubleutj profile image
Cdoubleutj

Depends on your definition of programming. I think programming is telling a computer what to do / how to do something.

Collapse
 
abhilearnstocode profile image
Abhii

I think programming is telling a computer what to do / how to do something.

Totally my point 😁 You cannot tell a computer to do something using HTML.

Thread Thread
 
cdoubleutj profile image
Cdoubleutj

That's not what i meant. I think writing html is telling the computer (to be exact the browser that runs on that computer) what layout the page has and what components should be rendered and also how those components should function (with tag attributes like min, max, step, type and so on). But i know that this debate will be never settled.

Thread Thread
 
abhilearnstocode profile image
Abhii

We clearly aren't on same page then. And I agree that this debate would never settle.

For the time being, let's agree HTML is not a programming language 🤝

Thread Thread
 
cdoubleutj profile image
Cdoubleutj

Let's just agree that if you think a programming language needs algorithms and logic then html is not a programming language. But if you think prorgamming is telling a computer what to do, then it is.

Collapse
 
robertadler profile image
Robert Adler

No, HTML (HyperText Markup Language) is not a programming language. It is a markup language used for structuring content on the web. HTML provides a way to organize and display information through tags that define the structure of a document. While it enables the creation of web pages and interfaces, it lacks the capabilities of a programming language, such as variables, logic, and control flow. HTML focuses on presenting information rather than executing computational tasks, distinguishing it from languages like JavaScript or Python.

Collapse
 
beastful profile image
Ilya Afendin

it does not mean that that it looses its status of programming language, html is just declarative, and not Turing complete.
Yes, Declarative programming is quite questioning term. But the key word is questioning not "clearly not a programming"

There are no special "exams" for programming langs, where they show what they can do, and based on this, get status of PL.

SQL is also a part of Declarative programming paradigm, its used only for queries (because its query language), but we still can call it programming

Collapse
 
cicirello profile image
Vincent A. Cicirello

Some dialects of SQL, such as PostgreSQL, are Turing complete, and thus very clearly programming.

Collapse
 
yawaramin profile image
Yawar Amin

Declarative programming doesn't mean 'can't express logic'. In SQL you can express 'show this or that based on some criteria calculated at runtime'. In HTML you can't.

Thread Thread
 
beastful profile image
Ilya Afendin

What? I didnt say that in declarative programming you cant express logic
Yes, in SQL you can calculate values and use logic, in HTML - no
I absolutely agree with the statement, but how is it related to the main question?
There is no strict definition where programming language should contain logic and variables.

Thread Thread
 
yawaramin profile image
Yawar Amin

If you redefine a programming language to mean 'a language that doesn't need to allow expressing conditional logic', then you can say anything is a programming language. Emojis are a programming language because they instruct the computer to draw pictures.

The reality is that every programming language must have a way to express conditional logic based on criteria calculated at (its) runtime. This criterion classifies things like XSLT as programming languages (correctly) and HTML as not programming languages (also correctly).

Collapse
 
nombrekeff profile image
Keff

Well... This is an age old question. Being objective it's not, as the name states (hyper text markup language). But it's debatable if it is or not. I don't really care, and neither should anyone really. It does not matter what we call it, it does what it does quite well, and that's the important part.

Collapse
 
anitaolsen profile image
Anita Olsen • Edited

Ever since I learned C++ several years ago, I have been aware that HTML is not a programming language (I associate HTML with web pages), it is a markup language (it even says so in the name). Thank you for pointing that out. Despite this, I have not understood how anyone can call HTML a programming language, and I got very surprised when I first came over some who called it that on X. Has there always been someone who has claimed that HTML is a programming language or is it a more recent claim?

Collapse
 
nombrekeff profile image
Keff

I think it's as old as the language

Collapse
 
thomasbnt profile image
Thomas Bnt

I always learn HTML is a mark-up language, not a programming language 😄

Collapse
 
buarki profile image
Aurelio Buarque

2 cents: AFAIK HTML is not! it's just a markup language. We may say it is primarily focused on presentation and structure of content, but nothing far from that :)

Collapse
 
tn2023 profile image
tn2023

HTML is a computer language and not a programming language. Specifically it is a DSL (Domain Specific Language) and under that it is a markup language.

Programming languages are generally expected to be "turing complete" which is much well defined idea. However this is not a hard rule because some folks put SQL under the programming language category where some of its flavors are not turing complete.

Despite the ambiguity of the definition of the word "programming language" I do not think any one would mistake HTML for a programming language.

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
beastful profile image
Ilya Afendin

Wrong example, absolutely wrong
html can be compared to profession where an engineer makes car using ready modules

Collapse
 
Sloan, the sloth mascot
Comment deleted
 
beastful profile image
Ilya Afendin

Why are you focusing on impact in development and complexity of an lang to find out if it is a programming language? Yes, HTML is just for page construction, SQL is for querying data, you cant do much with that.
But what do you call *shame *? "Programing language" is not a privilege, baggage, or a honorary status, its about science and definitions.
And by definition the thing you described called "imperative programming"(it also can be referred to other paradigms such as OOP).
in a nutshell, Imperative programming is a common way of programming for most people here.
Following this paradigm, your code should consists of commands, loops, statements, procedures, and with this set you change your global state (manipulating variables), and then your give a result

Now, lets talk about Declarative programming
Declarative programing is a way of writing a program when you focus only on result, but not an algorithm.
More about it

Yes, declarative programming languages are not Turing complete, so some people are struggling to call it "programming"(also me)
But its still programming

So the most correct thing you can tell about HTML is that it is not imperative programming language

But ....

It can be treated like declarative programming language

(I know about last two letters in HTML (Markup language))

Collapse
 
j471n profile image
Jatin Sharma

Nope.

Collapse
 
kurealnum profile image
Oscar • Edited

I'd ask yourself if Markdown is a programming language. I'm aware that the features, capacities, and intended use cases are wildly different, but at the end of the day, Markdown and HTML are both "markup" languages, and thus HTML is not a programming language.

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

Really spicy take: It doesn't really matter. It's a fun question to be pedantic about, and I'll happily argue over whether it is one or not just for the lulz.

But most people seem to be arguing for all the wrong reasons, and this just shouldn't be a matter of "are HTML people worth less than C people or not", because they're both valuable skills; and the same applies for discussions about other languages like CSS.

And the elitist attitude of some people really just spoils the fun of the discussion for me, honestly.

Collapse
 
nightdev profile image
Shviam

I would say that HTML is not a programming language because. it is a markup. It is also only possible to get full potential with CSS combined and both are different in the sense of syntaxes and code structure. and you can not make an entire webpag with it alone like with Python if you use Flask and other frameworks. so in short HTML is not a programming language but a side tool that helps in the process of making a website/webpage.

Collapse
 
gregorygaines profile image
Gregory Gaines • Edited

The fact this is a conversation is frightning in a sense.

Collapse
 
vuvtdhh profile image
Vũ Văn • Edited

Perhaps if you understand the role of these languages, everything will be easier.

  • HTML: tells the browser what to display by marking elements with tags (url, paragraph,...) - so it's a markup language.
  • CSS: specifies how the HTML will look (color, width, height,...) - so it's a style sheet language.
  • JavaScript: interact with data and the 2 things above.
Collapse
 
moopet profile image
Ben Sinclair

Is a Word document a programming language?

Collapse
 
beastful profile image
Ilya Afendin

Yes, it can be treated like that.
Word document has XML structure under the hood
And XML can be treated as a programming lang in a "Declarative programing" paradigm

xml - extendible markup lang
(I just dont want arguments like "it`s markup lang, just read the defenition")

Collapse
 
akechi523 profile image
Seiya Souda

No, HTML is not a programming language for 3 reasons:

1.It does not allow for the use of variables
2.It does not allow for the use of conditional statements
3.It does not provide any iterative looping structures

It's a markup language. In fact, that is the technology's name: HyperText Markup Language. That self-identified fact alone should settle the debate.

Collapse
 
ra1nbow1 profile image
Matvey Romanov

Definitely not. It is widely believed among novice developers that HTML is a programming language, but this is not the case

Collapse
 
beastful profile image
Ilya Afendin

Read about Declarative programming, and may be you will finally reach a level of "novice dev"

Collapse
 
best_codes profile image
BestCodes

While HTML is not a programming language, it is a crucial component for creating and organizing the content on web pages. So, no.

Collapse
 
nightdev profile image
Shviam

and well asked question. For your first post

Collapse
 
sergunik profile image
Serhii

no!

Collapse
 
ranjancse profile image
Ranjan Dailata

Hypertext Markup Language did create a big hype in the Y2K era. However, HTML is no were close to any programming language and will never be in the future!

Collapse
 
devshreeom profile image
OM JADHAV

As per my opinion no because it's just the structure language which contains the content and you know it cannot be used as for logical way.

Collapse
 
c9dn profile image
Shlok Madhekar

Unfortunately Not, I believe that HTML is a method of providing structure, and the processing is done by Javascript, a programming language.

Collapse
 
oliversieto profile image
Renato O da Silva

In my opinion it' not. HTML it is amazing, but it works as markup language. HTML is necessary for web life and it's very important, but HTML it is a markup language as xml as well.

Collapse
 
priyabapodra profile image
Priya Bapodra

Obviously not! HTML is scripting language!

Collapse
 
whitesnow1022127 profile image
whitesnow1022127

I think HTML is not programming language.

Collapse
 
valvonvorn profile image
val von vorn

If HTML is not a programming language, because it is a markup language, then JavaScript is not a programming language, because it is a scripting language, and the USA is not a country, because it is a union of states. Features are mutually exclusive and any subject can only be one thing or another at the same time.

Collapse
 
perssondennis profile image
Dennis Persson

It's a language, and the purpose of the language is to be used when you program a website. And in the end, it constitutes a great part of the resulting website.

Then it's not very impressive or useful on its own, so no need to mention it in a resume regardless of whether it's treated as a programming language or not.

Collapse
 
beastful profile image
Ilya Afendin

So, i would say that people who just say "No", "Absolutely no" or "Did you see that three is Markup Language in HTML", are absolutely mistaking. They just need dive deeper in computer science.
The fact that HTML is a part of Declarative programing(yes PROGRAMING) paradigm (Like CSS, SQL, XML etc.). In a nutshell, declarative programming is a way of programming when you tell computer what kind result you want to get, and don't think much about algorithm itself. So Yes, HTML's programming language status is quite questioning, but only because it's not Turing complete.
And arguments like "it`s markup lang, look at two last letters in HTML" or "we cant create algorithms with that" are just stupid.

"it`s markup lang, look at two last letters in HTML" - it does not deprive it of programing lang status

"we cant create algorithms with that" - OF COURSE, BEACUSE IT IS DECLARATIVE PROGRAMMING, and most of languages of that paradigm are not Turing complete.

In my opinion, we don't need to give straight and "ONLY POSSIBLE" answer, in different cases we can treat HTML differently.

Btw, Declarative programming is also doubted to be "programming", it's mentioned on wikipedia. Doubted, but it's still programming )

Collapse
 
eljayadobe profile image
Eljay-Adobe

When you say "HTML", are you including CSS and JavaScript?

Collapse
 
cbid2 profile image
Christine Belzie

Ah yes, the question (after the one about burrito being a sandwich) that has sparked long debates. In my opinion, HTML is a programming language. It's the foundation of websites and many other online tools. It's like the tortilla of a burrito. Without it, you have a mess. Thanks for posting this @anitaolsen! :)

Collapse
 
anitaolsen profile image
Anita Olsen

You are very welcome! 😀

Collapse
 
codingjlu profile image
codingjlu
Collapse
 
adimalu profile image
Admalu

It's quite confusing knowing that HTML is not a programming language
HTML should be defined as a light programing
It has no logic however it passes instructions to the computer.
Somehow in my opinion this is logic.

Collapse
 
hurre profile image
Abdirahman Hurre

HTML is not a programming language. It's a markup language used to structure content on the web. Unlike programming languages, HTML doesn't have variables, loops, or conditional statements. It defines the structure and presentation of web content.

Collapse
 
wisesek1 profile image
Info Comment hidden by post author - thread only accessible via permalink
wisesek

HTML (Hypertext Markup Language) is not considered a programming language; it is a markup language used for structuring content on the web. HTML provides a way to organize and format the elements on a webpage but lacks the ability to perform complex computations or logical operations. For tasks requiring programming, additional languages like JavaScript are typically employed. If you are seeking an affordable web designer in Chicago to enhance your website, consider exploring local design services that align with your budget and requirements.

Collapse
 
clsource profile image
Camilo

No. It's on the same boat as JSON, XML, YAML.
They are not a programming language, neither HTML (unless you consider that odd programming language named HTML).

Collapse
 
harshtankio profile image
Harsh tank

Html probably not but now a days css is.

Collapse
 
anitaolsen profile image
Anita Olsen

Woah, that was a new one. English is probably a programming language as well!

Collapse
 
console_x profile image
F. Güngör

yes and better than php

Collapse
 
kushkrg profile image
Lavkush kumar

mY Teacher used to say HTML is a markup language so I just agreed his words... cos I don't wanna break his Heart.. ;) 😄

Collapse
 
anitaolsen profile image
Anita Olsen

Hahah 😄 But it is a markup language, it even says that it it's name: HyperText Markup Language (HTML).

Collapse
 
cdoubleutj profile image
Cdoubleutj

Weak argument. At least say why you think a markup language is not a programming language

Some comments have been hidden by the post's author - find out more