DEV Community

loading...
Cover image for HTML is a programming language

HTML is a programming language

videlalvaro profile image Alvaro Videla ・2 min read

Every now and then we read debates that HTML is a programming language, that it isn't a programming language... I don't understand the point of the debate. It seems to come from a group of people that want to gatekeep who gets to be called a programmer. In any case, having this debate without defining what we understand as programming language makes no sense. So let's look into that.

The canonical source when it comes to programming language classifications is Jean E. Sammet 1969 book Programming Languages: History and Fundamentals. She was an early computer pioneer, where she helped design COBOL among other programming languages. She was the first female president of the ACM so that says a lot about her career impact in computer science.

In that book she provides a couple of defining characteristics for programming languages. Let's see if HTML meets them:

Machine Knowledge Is Unnecessary

In this case "a programming language requires no knowledge of the machine code by the user". The user shouldn't learn about registers, how numbers are represented by the machine, and so on. This doesn't not mean, as Sammet clarifies, that the programmer cannot learn about these characteristic of the machine in order to write better programs, is that it is not required to know them to use the language.

HTML meets this characteristic.

Potential for Conversion to Other Computers

From the previous characteristic we can derive the second one. If the user can ignore the machine in which the program is going to run, a programming language thus must be able to be ported to different machines. Programming languages should be machine independent as Sammet says.

HTML meets this characteristic. It runs in every browser in most modern computers out there.

Instruction Explosion

In this case when the program is translated to machine code, each statement in the program should produce multiple machine code instructions. Also says Sammet, the user doesn't need to write any of this machine code for their program to work.

HTML meets this characteristic.

Problem-Oriented Notation

"A programming language should have a notation which is somewhat closer to the specific problem being solved than is normal machine code". So instead of doing:

CLA C
MPY D
ADD B
STO A
Enter fullscreen mode Exit fullscreen mode

A problem oriented language would have a syntax like this:

A = B + C * D
Enter fullscreen mode Exit fullscreen mode

HTML meets this characteristic. It's pretty clear that HTML fits this requirement.

So based on her selection criteria I would assume that HTML would have made it into her book mentioned above.

Where is Turing Completeness?

As you can see, in Sammet requirements for programming languages, Turing completeness is not part of them. Even more, Alan Turing is not cited in the book, among the hundreds of references cited there, not one of the was Turing. Which makes us wonder what was the influence his ideas had back in the 60s when we had the programming language explosion.

Discussion (15)

pic
Editor guide
Collapse
darkwiiplayer profile image
DarkWiiPlayer

The main argument against HTML being a programming language: In that case YAML is also a programming language. CSV is also a programming language. Maybe even plain text is a programming language (we use it to represent programs that output static text).

Is there some hard line between C and HTML that would let us clearly distinguish one as "programming" language and the other as "non-programming" language? Not really, at least I haven't found a good one.

The closest thing is probably that in C, Lisp, Haskell, etc. you can implement algorithms, which in HTML you don't. HTML "programs" don't "run" in the physical sense (as in, they're not turned into machine instructions and executed), nor in the conceptual sense (Instructions don't get executed sequentially).

Either way, classifying HTML as a programming language is about as useful as classifying flower gardening as "farming". The whole "gatekeeping" debate is just an extremely dishonest at disqualifying peoples arguments by attributing malice to their position. As long as this is the level on which discussion happens, I can only look at the whole debate with disgust.

Collapse
darkwiiplayer profile image
DarkWiiPlayer

To expand on the whole "gatekeeping" argument, I find this whole debate absurd all the way from conclusion to premise. Do people who develop HTML somehow miss out on something by not being considered "programmers"?

Community

HTML development has its own subcommunity in the IT world with large overlap with the programming community. There's no hard separation here; many people do both, those who do only one often treat the other as a sort of parallel discipline that's still part of the larger group. There's no "Programmers vs. HTML devs" divide that has to be overcome.

Status

Programming has always been a discipline that requires skill and knowledge. Not everyone can just learn it all the way to becoming an expert, so those who can and do are usually paid well and generally assumed to be smart. This is an image that HTML has yet to achieve, mainly because people tend to think of "building websites" as more of a creative task and forget the very technical aspect of turning a design (often made by completely different people) into an actual website that can be put on the web.

This image problem, however, will not be solved by incorporating HTML into the programming label.


So yea, in conclusion, the whole "gatekeeping" argument doesn't lead us anywhere meaningful. There's no reason why anybody would want to gatekeep, nor any harm done by the distinction.

If people want to call themselves programmers, they can just learn programming, it's that simple. It will even benefit them in their HTML-related work, which can often be automated with a bit of scripting magic.

Collapse
stainlessray profile image
stainlessray • Edited

Your entire argument was that it is trivial to determine. That being the case, I wonder why your opinion on that question was included along with said reasoning, in your answer πŸ€”.

Seems like it matters enough to warrant your default position. The reason people gate this way is to feel special. It's not rational.

The entire web was not built on notation or markdown. The interoperability with other languages (other, not actual), the inability to discover a solution to the need for HTML knowledgeable PROGRAMMERS, suggests it's a pretty important language.

Thread Thread
darkwiiplayer profile image
DarkWiiPlayer

The reason people gate this way is to feel special.

To me it seems to be the other way around. Most programmers probably know that there's nothing special about being a Programmerβ„’, but there's a constant push from HTML developers that want to be included in the group even though it seems factually wrong to many people, and my suspicion is that they want to feel special. Otherwise, why would they care at all?

And to repeat my point a bit more clearly: Reading a list of reasons why HTML might not be a programming language and reacting by calling that "gatekeeping" is toxic. Any reasonable person will just walk away from such a discussion, as they should, and only a few who argue from emotion will stay behind.

Collapse
33nano profile image
πŸ‡΅β€‹β€‹β€‹β€‹β€‹πŸ‡°β€‹β€‹β€‹β€‹β€‹πŸ‡³β€‹β€‹β€‹β€‹β€‹

HTML is a programming language, Javascript is a scripting language. If you feel triggered, remember that, Go is the best language on planet Earth.

Collapse
hb profile image
Henry Boisdequin

I would have to respectively disagree, Rust is the best language on planet Earth :)

Collapse
darkwiiplayer profile image
DarkWiiPlayer

Both wrong: It's Lua 😜

Collapse
houdinii profile image
Brian B.

Over time my view has kinda evolved into "Why can't it be both" a simple markup or a language? Sure, back when I first laid eyes on HTML well over a decade ago, it was a bit simple. But now it's a bit meta as far as what it can do. It is where it all comes together after all. As far as I'm concerned, the semantics between a markup language and a declarative language is subtle enough not to lose sleep over. I think the only ones losing out are the brand new beginners who are proud of learning what we all take as super basic.

Collapse
narasimha1997 profile image
Narasimha Prasanna HN

Okay, if HTML is a programming language, can you add two numbers in HTML? Without JavaScript??? No right??

If HTML is a programming language, then what was the need for JavaScript? If your logic is correct, markup languages like Markdown, LaTex will be called "Programming Languages".
Also, the same with JSON, YAML, TOML etc, are they programming languages?? No right?? They are just ways of specifying information which are parsed by programming languages. HTML is also like a specification language, which is parsed by a parser embedded in the browser or whatever tool.

Again, another point, The basic property of any programming language is to throw syntax error or atleast a warning when something is not right. But it's missing all in Markup languages, that means, they are designed not be programming languages. The purpose is different.

Collapse
donut87 profile image
Christian Baer

HTML is not a programming language. There are no programs to run on computers as output. So the point about 'HTML runs in every browser' is not quite correct. Every browser is able to display HTML, because this is the main idea of a browser.
How can it be a programming language, if there is no program to be run, but just data displayed? You can very well load programs (written in JS and CSS) with the same browser, because it is linked in the HTML document (document! not program).

Collapse
jaqko profile image
Jacko

In my opinion, you’re rightβ€”to a certain extent. HTML can be classified as a programming language with that definition, but it isn’t a programming language like JavaScript is. The definition of programming has mostly been just writing computer programs, and HTML is definitely capable of being a programβ€”but people just look at it differently when compared to more modern languages.

Collapse
ronald_arias profile image
Ron

This is just a semantics problem actually.
Whether you call yourself a programmer based on using HTML or not is a completely different thing.
HTML is NOT a programming language, it's a MARKUP language. They are different and they have different purposes. You can still be a programmer if all you use is HTML, but that doesn't make HTML something that is not... semantically ;)

Collapse
maciekgrzybek profile image
Maciek Grzybek

HTML - Programming language or not? In my personal opinion, this is the most stupid argument in the history of the internet :) Honestly, who cares? :)

Collapse
sleepybear1x profile image
SleepybΓ¦ • Edited

OMG GUYS!!! I JUST FOUNT OUT HOW TO mAKE A VAriaBLE IN HTML!!!!

dev-to-uploads.s3.amazonaws.com/i/...

Real talk though, HTML is just glorified text. the computer does all of the processing. you can not make interactive design with HTML. it is static, and thus not programmable.

Collapse
mrtheyann profile image
Yann • Edited

There's nothing to discuss here. Sorry.