Comment by MrJohz

1 month ago

Of course HTML is a programming language. It's one of the languages I use every day to program with. I'm not sure what the definition of a programming language would be beyond that.

Do you mean "Turing-complete" language? Or maybe "procedural programming language"? I agree HTML isn't either of those, but those aren't the be-all and end-all of programming now, are they?

I, and most of us, mean a language in which one can express a computer program, which is a set of instructions for a computer to execute. You don't execute an HTML file, you display it, render it. You can't implement fizz buzz in HTML. At best, you mark up its output. With HTML, you don't instruct, you describe. You instruct what to do with JavaScript, or Python, or whatever programming languages you use client or server side.

A programming language doesn't need to be procedural, it can be functional, or use another computationally equivalent paradigm. I'm not quite sure it needs to be Turing complete, but possibly.

A programming language lets you express to some processor that provides a set of computation primitives what to do with the memory cells you have at your disposal, and in general it lets you deal with input and output.

If you consider any language you program with to be a programming language, then CSS, JSON, YAML, XML, markdown (that's what your readme is likely written in) and even English (that's what you use to express the specs, the bugs, maybe your notes / drafts, the comments, possibly the language the singer of the songs you're listening to while programming use) or UML need to be programming languages too. That's not quite useful. "Program with" is too large and would make the "programming" qualifier largely useless.

https://en.wikipedia.org/wiki/Programming_language

https://en.wikipedia.org/wiki/Computer_program

https://en.wikipedia.org/wiki/List_of_programming_languages

https://stackoverflow.com/questions/14512218/is-html5-a-prog...

  • An HTML file is a set of instructions to execute. They're very high-level, declarative instructions for describing a UI, similar to how SQL is high-level declarative instructions for describing a set of data to be loaded, or how Prolog is a high-level declarative set of instructions for describing a set of logical axioms, but they're still instructions. You pass them to an execution engine, and on the basis of the instructions you've written, the engine does something. (See e.g. the section on fourth generation PLs in the second link you gave.)

    More broadly, I think this discussion is a stupid one. There is no formal, mathematically precise definition of a programming language. There are formal definitions of lots of PL-related things, and for what a language is in general (a combination of syntax and semantics), but there's no formal definition of the term "programming language" that's useful here.

    So if we're not arguing about a formal definition, then we're arguing about essentially our favourite dictionaries, and how we personally interpret our favourite dictionaries. And that's just not a useful argument at all, it's not even how dictionaries are meant to work! And yet whenever someone dares to write "HTML programming language" or something similar, there is always a comment from someone demanding that the author use their personal dictionary, and correct their changes. And it is deeply grating, because whenever I see this happen:

    * The original statement is never ambiguous. I have never seen a situation where referring to HTML as a programming language has ever caused some sort of confusion.

    * The discussion about whether HTML is a programming language is almost always completely irrelevant to the topic at hand, and bringing it up adds no value to the discussion.

    * The author's definition is usually inconsistent anyway. Which isn't a problem — I don't imagine my mental definition of a programming language is entirely consistent either — but it's dumb watching someone try and correct other people without understanding their own definition enough to be able to respond to clarifying questions.

    In your original comment, you said "it's not really a debate", and that's completely correct. It's not a debate because there's no right answer. There's not even any value to a right answer. The matter is entirely a question of terminology. And if different choices of terminology make things unclear, then it might be worth clarifying that terminology, but here I don't think the author could have been any clearer at all about what they were trying to communicate.

    • > More broadly, I think this discussion is a stupid one

      Mostly agree (although reasoning about these things can be interesting). More on this at the end of the comment.

      > So if we're not arguing about a formal definition, then we're arguing about essentially our favourite dictionaries

      It's also a matter of the most widely accepted definitions, not just what definition one prefers. And it seems to me not considering HTML as a programming language is what's most accepted and for good reasons.

      We need a common understanding to communicate.

      > I don't think the author could have been any clearer at all about what they were trying to communicate.

      They just make their expression more confusing and more complicated by needlessly qualifying HTML and putting this footnote when they could have skipped both the footnote and the qualifier.

      Here I was in fact mostly concerned about the clarity and the presentation. That page seems to be written for newcomers, qualifying HTML as a programming language doesn't seem quite optimal given the (supposed) target, I think it would do a disservice to someone who has not a great understanding of those things.

      So the better way of exposing things IMHO is just not mentioning it at all, and if someone wonders whether HTML is a programming language, they can do their own research.

      > An HTML file is a set of instructions to execute

      I believe it's a stretch to describe HTML like this. Your explanation makes it work, but I don't think it's a usual way of viewing HTML. In any case it seems to me presenting HTML like a set of instruction to execute to a newcomer would just be weird.

      Now, this discussion wouldn't matter much between people who have such a clear understanding of these things as you. When everything is this clear, deciding whether HTML is a programming language is indeed a purely intellectual exercise that can totally feel pointless and where both positions are probably reasonable depending on the perspectives, and yes, on the exact, clarified definition one uses.

      So I was wrong: there is a debate. It was incautious of me to state otherwise. And the debate is mostly pointless for whoever clearly understands the involved concepts. And I should have focused on the pedagogical aspect of this stuff, not on whether it's wrong.

      I will definitely handle such a discussion differently next time, if I don't outright skip it.