DEV Community

Cover image for Coding 101: Is HTML a Programming Language? Why or Why Not?
Ben Halpern for CodeNewbie

Posted on

Coding 101: Is HTML a Programming Language? Why or Why Not?

Let's settle the age-old debate: Is HTML truly a programming language or not? Join the discussion to explore the essence of HTML, dissect its features, and uncover the reasons behind its classification as a markup language rather than a traditional programming language.

This week's discussion series is dedicated to helping beginners on their coding journey by addressing common doubts and misconceptions. We will delve into fundamental concepts, explore essential tools, and shed light on industry practices, providing clarity and guidance to those who are new to coding. If you're an experienced developer, your valuable insights, explanations, and best practices are highly encouraged and appreciated to support and mentor aspiring coders!

Follow the CodeNewbie Org and #codenewbie for more discussions and online camaraderie!

Image by brgfx on Freepik

Top comments (33)

Collapse
 
lionelrowe profile image
lionel-rowe

Collapse
 
psypher1 profile image
James 'Dante' Midzi

Hyper Text Markup Language.

It's a markup language - it's in the name

Collapse
 
phlash profile image
Phil Ashby

What's your take on Structured Query Language? Are SQL and HTML subsets of the wider programming language concept (this is my take), or are they disjoint? If so, then SQL isn't a programming language either... discuss 😁

Collapse
 
cicirello profile image
Vincent A. Cicirello • Edited

Some dialects of SQL are Turing Complete, such as PostgreSQL (wiki.postgresql.org/wiki/Cyclic_Ta...). I'd consider those dialects of SQL to be programming languages, but others I would not. If it is Turing Complete, then you can express any computable function with it. So for me, any language that is Turing Complete qualifies as a programming language.

Does something need to be Turing Complete to be a programming language? There are some who would answer this with a "yes." I'm not one of them. There are some languages that are almost Turing Complete, other than that they require a bound on number of iterations of loops. The BlooP language of Douglas Hofstadter from his book "Gödel, Escher, Bach" specifies bounds on loop iterations. Its name means Bounded Loop. Because of those bounds, it is not Turing Complete. However, I would consider it a programming language.

Now for HTML.... I don't consider it a programming language. It is not Turing Complete, but as above, that alone (for me) doesn't eliminate it. What is its purpose? To specify structure of content. What else can you do with it? Not much else by itself.

The combination of HTML + CSS is sometimes claimed to be Turing Complete. When you look closer at such claims, it is really the combination of HTML + CSS + user interaction that leads to Turing Completeness. To me, requiring presence of a person is cheating, even if all they are doing is clicking on stuff. Without that clicking, you don't have iteration. If HTML + CSS had some limited form of iteration, like that of BlooP, I'd consider it a programming language.

Thread Thread
 
joshuaamaju profile image
Joshua Amaju • Edited

But they said it's in the name 😂, if we're to go by their initial logic

Thread Thread
 
cicirello profile image
Vincent A. Cicirello

@joshuaamaju I said nothing about its name. That was @psypher1. But he is not wrong. The M in HTML gets across its purpose, which is not programming. It isn't trying to be a programming language.

Thread Thread
 
joshuaamaju profile image
Joshua Amaju • Edited

So I guess JavaScript isn't a "real" programming language like people think about scripting languages, because it has script in its name 😏

Thread Thread
 
cicirello profile image
Vincent A. Cicirello

JavaScript is Turing Complete. It is just as much a programming language as any other Turing Complete language, like C, Java, Go, etc.

Thread Thread
 
joshuaamaju profile image
Joshua Amaju

I know that, but if we're to go by your logic of "it's in the name", then JavaScript isn't a "real" programming language. So maybe it's not just the name

Thread Thread
 
cicirello profile image
Vincent A. Cicirello

I never said anything about its name in my opinion. That wasn't my logic.

Thread Thread
 
joshuaamaju profile image
Joshua Amaju

But you said the person that used that logic is right, which means you agree with that logic

Thread Thread
 
cicirello profile image
Vincent A. Cicirello

No. I agreed with the essence of that comment that its name implies that it isn't intended to be a programming language. But some things can be used for purposes other than intended. Few people would consider the game Minecraft to be a programming language. It is not its purpose. However, it is Turing Complete. So in theory you can use Minecraft as a programming language. Does that make Minecraft a programming language because you can use it as one? I want to say "no", but it meets any functional definition of "programming language" that I can come up with.

My opinion on why HTML is not a programming language goes beyond its name. See my earlier comment on why the combination of HTML + CSS is almost a programming language.

Collapse
 
malzeri83 profile image
malzeri83

Agreed

Collapse
 
manchicken profile image
Mike Stemle

Is it a coding language? Maybe; depends on your definition of “coding.” Is it a programming language? No. It kinda doesn’t matter, these are all tools to get accomplish our work. It’s all hammers and duct tape to me. Some tools ratchet and some tools don’t.

At the end of the day, though, I feel like most folks who have strong feelings about this distinction are telling on themselves and their own insecurities or sense of unearned superiority.

Collapse
 
thumbone profile image
Bernd Wechner

Is this not just a distracting word game? Is this a table or a chair?
Image description

Collapse
 
cicirello profile image
Vincent A. Cicirello

That can be used as either a table or a chair (or as a step stool). It was likely intended to be one of them. It has the characteristics necessary to be used as any of them.

Collapse
 
thumbone profile image
Bernd Wechner

And debate around that would seem to be, a distraction at best, a waste of time at worst and likely, contain doses of ego and entertainment. Which was the point of the analogy.

Thread Thread
 
cicirello profile image
Vincent A. Cicirello • Edited

There are people who research formal languages for a living (not me). I prefer not implying that someone's work is a waste of time, or for that matter what someone chooses to debate. That type of opinion is best kept to oneself. Sometimes what someone views as time wasting, another finds a useful "distraction".

Thread Thread
 
thumbone profile image
Bernd Wechner

I doubt that most people who research formal languages don't spend any effort discussing whether a markup language is a programming language or not. Perhaps they do? But I suspect not. It's moot point, and not one with resolution.

Far more interesting is a similar boundary question, are viruses alive? Biological ones not computer ones. Though oddly, as interesting as it is it immediately makes clear that the answer lies very simply in the chose definitions of the categories alive and not-alive. And I choose that example because defining those is of deep interest to many people (as they feel themselves to be alive, a rock not and are intrigued by the boundary)but also not to most as it is simply moot.

Do take not however that there is no dismissive insult in suggesting sometimes is a distraction, nor that people engage in conversations for entertainment (or, stimulation if you prefer), including professionals research categories and boundaries, specific or general. Nor is it uncommon to find less noble motivations ins such discussions.

Thread Thread
 
cicirello profile image
Vincent A. Cicirello

I wasn't bothered by "distraction." Distractions can be good. It was the "waste of time" that is harsh.

Thread Thread
 
thumbone profile image
Bernd Wechner

I did write "at worst" as a qualifier. Surely, at worst, most things might receive a slightly or very harsh description? It is after all the superlative, and used in fact primarily to constrain the degree of judgement. That is, at worst, it's a waste of time, it could conceivably be any worse, in case you were worried ... And eating time is not to my mind very harsh, we all do it from time to time, inadvertently or even deliberately.

Collapse
 
joshuaamaju profile image
Joshua Amaju

Distracting from what?

Collapse
 
thumbone profile image
Bernd Wechner

Using HTML. And well, anything more useful. Unless of course it has entertainment value or ego stroking power, two big motivaters to dive into labelling debates.

We are categorising creatures I guess and drawn to categorising but can lose good time trying to squeeze outliers and boundary items neatly into categories we've invented, when we could among other things get on with better things or, and this one is often overlooked, define a new category or categories.

Of course the astute reader will spot that this side conversation fits that same description. That is, it might not be the best use of our time.

That said, I often find the meta themes, the "why are you asking?", "what do mean by ...?" etc more interesting than the question on the table.

For example, I certainly teach my children and others that science is less about finding answers than it is about asking the right (good) questions.

Thread Thread
 
phlash profile image
Phil Ashby

The cynical might observe that this conversation could be an attempt to keep people on this platform by introducing 'hot topics'.. those of us who hope Ben wouldn't stoop to that sort of tactic (please don't Ben!) may also think that this could be a way to introduce your exact points above to the coding 101 audience 🙏

Not wanting to push the philosophical conversation too far (we may be accused of going off topic, heaven forbid 😉), I wish we were less of a 'categorising creature', since a lot of the boundaries we invent are not very useful and often actively harmful (generation X anyone?) creating in-groups and out-groups, them and us... I'll stop now!

Collapse
 
phlash profile image
Phil Ashby

Haha, Ben you do like poking trolls eh?

It's a funnel of abstraction - electrons and quantum mechanics at the most concrete, Excel at the most abstract (I'm joking, maybe something like Human-Computer-Interaction design at the top, or C4 architectural designs). HTML? it's towards the abstract in the textual & declarative categories, along with the CSS. Quite near SQL.

There are professors who study this stuff: researchgate.net/publication/22011...

Merriam-webster defines programming as: "the process of preparing an instructional program for a device (such as a computer)" - the language you use to provide those instructions is by definition a programming language: this could be encoded text (eg: ASCII), visual (eg: barcodes), audible (eg: 'Hey siri'), physical (eg: up, up, down, down. left, right, left, right, B, A, start - sadly gone: npr.org/2020/02/26/809622331/kazuh...)

If you need a laugh - go search out some programming language alignment charts... 😉

Collapse
 
angelotheman profile image
Angel Oduro-Temeng Twumasi

Hi Ben,

This is a very debatable topic depending on who you speak to. HTML is mostly the first thing any computer programmer/ Web developer learns about and hence becomes the first "language" for every beginner programmer.

Personally, I wouldn't really classify it as a programming language 😅.

Career Foundry has some wonderful answers

Collapse
 
versacodes profile image
Franz Amersian

A little bit... We can't do logic stuff in HTML. CSS you could do basic maths.

HTML for structuring just like drafting a drawing first and CSS for styling just like applying ink or paint in a drawing.

Collapse
 
baenencalin profile image
Calin Baenen

Yes, semantically, by definition; I have seen the video that @lionelrowe suggested, HTML IS a Programming Language (Imperative vs Declarative) - Computerphile, but I believe my reasoning is different.

A programming language, or programmeringsspråk, is:

Collectively, diction and grammar rules that come together to make a language that is understandable by humans and computers, used to create programs, interfaces, and the like.

HTML is all ov those things.

  1. It has diction; it has <html>, <h1>, <p>; it even has entities, &nbsp;.
  2. It has grammar rules; elements can not overlap, so no <p><b>Hello, </p>world</b>; an opening tag must have a closing tag, so a <p> must eventually be accompanied by a </p>.
  3. It is understood by humans an computers. — While the computer can't understand HTML directly, and needs an environment to be interpreted in, it can still be understood by a lot ov programs; if this fact disqualified something from being a language, then Python wouldn't be a programming language either.
  4. HTML is understandable by most people who learn to read and write it.
  5. HTML is used for at least one ov these purposes, creating interfaces.
Collapse
 
mellen profile image
Matt Ellen

Yes it is a programming language, it's just not "Turing Complete".

It's a declarative language that tells a computer to do something.

Collapse
 
arjuncodess profile image
Arjun Vijay Prakash

According to my school, HTML "is" a programming language.
like WTF, HTML and Programming Language? Its a markup language dude!

Collapse
 
joshuaamaju profile image
Joshua Amaju

To the "HTML is not a programming language" crowd, watch this and remain silent forever

Collapse
 
rajivkumarkale profile image
Rajiv-Kumar-Kale

Please write a program to find first 100 prime numbers in HTML.

Some comments may only be visible to logged-in visitors. Sign in to view all comments.