DEV Community

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

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.