Is HTML a programming language? I could express a bit of shock, even dismay, at the question, but instead, I’ll try a more polished approach. In some sense, it may be a legitimate question, in which case it deserves a fair answer. In another sense, it may be an attempt at gatekeeping. I suppose that also must be addressed.
My first concern is, what value would it be to say it isn’t a programming language? Does it bring us some clarity as to its purpose? Is there a doubt that HTML is used by programmers to create UIs? Is there doubt that HTML has source code? Do we doubt that HTML source code is subject to the same issue systems, requirements management, version control, peer review, and testing like any other source code? I’m not certain what clarity it would bring to say it isn’t a programming language.
However, before I conjecture on what else we could be asking, let’s take a more technical look.
HTML is a declarative programming language. Unlike an imperative programming language, which tells a computer how to do things, a declarative language tells the computer what the result should be. The engine that processes the code figures out a way to get the system in that state.
There are a lot of domain-specific declarative programming languages. Configuration files generally fall into this same category. The lists of options declare how you want a system configured. In DevOps, configuration is consistently referred to as code.
Occasionally we’ll see Turing completeness brought up in the discussion. Turing machines have been a wonderful tool in analyzing computation, and algorithms in general. They are used when talking about computability, whether we can find the answer to a problem. Though they can simulate a lot of languages and machines, they’re terrible models of real-world practical computing. They simulate, but can not model, many features we’d expect — including something basic like random access lists.
If we’re asking what a programming language is, I think we need to stay at the practical level. Let’s leave Turing completeness to the theory. A proper discussion in that realm requires going into a lot more detail. I’m not dismissing it. I find it fascinating, but not relevant to our question.
What might be a practical definition? How about a programming language is a set of codes that unambiguously instructs a computer as to what it should do. HTML instructs the computer how to create a visual document, or app interface, for the user. Python, Java, or C++ give sequences of commands that tell the computer how to manipulate memory, modify files and talk on the network. Haskel, or O’Caml create structures of equations that calculate results.
I might need to be careful with that “unambiguous” bit, as many languages have dark corners to them: unintentional defects in the language, intentionally unspecified behaviour, and the outright nasty undefined behaviours. So, we’ll have to live with for-the-most-part unambiguous.
Different languages instruct the computer differently. We recognize they aren’t all appropriate for every situation. There is no all-domain all-purpose language anymore.
Back to the question then, what value does it bring to say HTML isn’t a programming language? I fear the answer is related to gatekeeping. Some individuals feel a need to distinguish the quality of programmers based on some artificial goal posts. It helps keep the role of programmer artificially elite — for some definition of elite.
It’s not like the label “programmer” magically makes one qualified to do all types of programming. It’s a large field. We have lots of tools and lots of approaches. Somebody who knows only HTML won’t likely be hired to program a game engine or embedded sensor. Nor would a data analyst specializing in NumPy be a good fit for a mobile interface.
But even still, who only knows HTML? Perhaps we’re talking about UI/UX designers that use it to create prototypes. These are people that will work with a programmer to help them get what they want. I don’t think they’re clamouring to be recognized as programmers themselves? I do consider them developers though; I have a chapter in my book about why I think this is important.