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 s...
For further actions, you may consider blocking this person and/or reporting abuse
"what value would it be to say it isn't a programming language"
What value would it be to say it is one?
Some people feel better when they say HTML isn't a programming language because they think they are now better than people who only know HTML.
Some people feel better when they say HTML is a programming language because they now think they're on a level with people who know other languages.
Both don't add anything meaningful to the discussion.
Quite correct.
I think the only meaningul distinction is between a general purpose programming language, and a domain-specific programming language.
It seems to me that HTML is the latter.
Qualifying it as a "true" or "false" programming language (or Scotsman, wink wink) doesn't really matter, however I do think qualifying it as a DSL does add meaning.
You could say the same about any categorisation. There is a reason why you are a human, a mammal, an animal, a life form. Those might seem unnecessary labels but they tell us what you do, what you are capable of. Same with languages.
Indeed.
There is a point at which all meaning is lost in detail, and that is in general, not where you want to be. Hence my approach to try and find a lowest common denominator that lessens my own cognitive load.
Sure, but seems like semantics to me.
Is it a markup language or a domain-specific language?
Isn't a markup language a domain-specific language?
In my opinion, semantics matter. Granted, only up to a point, but I personally draw my own line there. DSL is good enough for me, that's all I'm really saying, I'm not trying to solve a metaphysical issue.
No: HTML is not a programming language.
Also No: this doesn't mean it's any less valuable of a skill.
Also not programming languages: xml, yaml, json, markdown. They don't need to be called programming languages to be considered valuable skills.
Saying HTML is not a programming language while JavaScript is, makes no comparison between the 2 languages at all. It is indicative of each language's abilities and uses.
HTML - some text which makes computer do something e.g. display a form or a text etc. How that is not a programming language?
Here is good paper on PL classification if you have any further doubts
HTML does not make, or instruct, the computer to do anything.
The above HTML snippet could be viewed as a key/value pair. The key being
title
and value beingPage
. There is no instruction to store, display, or interpret this value.Another way to view it is that there is one piece of information "Page", which has markup code wrapped around it to define what type of data it is, "title". In being a markup language HTML essentially defines meta-data.
HTML has no instructions, it cannot actively do anything or instruct a computer to do anything.
Again, this does not make it any less or more in status than a programming language. A markup language just isn't a programming language; and that's OK.
I think the distinction between markup and program/logic code is important, it's a matter of accuracy and managing expectations.
You saying "instruct" as if
alert('Hey')
(or any other JS function) have some magic powers to actually instruct computer. No it doesn't. Browser reads it, converts to instruction set, sends it processor (or GPU or...) and eventually machine executes it.What happens with HTML? Browser reads it, converts it to instruction and send it to machine, which executes it.
That sounds like over-simplyfication to me.
You could also say that about writing into Word document. Word have to do the same to be able to display formatted document, but it doesn't make Word a programming language.
I'm not fully agree with the idea. HTML is a markup language, it contains no programming logic and is not Turing complete.
We must distinguish between languages, otherwise will be a general confusion and someone can consider any language as a general purpose programming languages.
Please point to the dictionary that states that Turing completeness is a requirement for a programming language. I will save you some time... they don't.
Where'd you get those rules though? I don't agree with them, personally. I'd rather use a definition more like, "A programming language is any human-readable language that allows a writer (i.e. programmer) to unambiguously instruct the computer to perform a desired set of actions". HTML certainly falls into that definition.
And anyway, while HTML on its own may not fit your above three rules, I'd argue that the HTML+CSS combination does.
@media
queries,:nth-child()
selectors, etc.@
-rules like@media
queries "change the flow of execution" in that they produce a different set of CSS rules, which changes the flow of the rendering pipeline.To be honest, these rules are pretty questionable even outside of this discussion, especially the
goto
rule. There's no nativegoto
in many classic languages, e.g. JavaScript, Haskell, Prolog, and many Schemes. If you didn't mean a literalgoto
, but rather anything that allows moving to another bit of code at will, then how does this differ from the function call rule?This is sort of beside the point of the article, but I think another interesting approach to take on this age-old topic is to consider HTML+CSS together as a programming language instead of just HTML by itself. CSS layers on top of HTML, and it introduces a lot of constructs that could be considered logical statements and execution-flow-controls, e.g.
@
rules and:nth-child()
selectors.I definitely agree with you here. Prior to reading this article, I have always seen HTML as strictly a markup language that defines the structure of a document. Indeed, it is "just a markup language", but combined with other technologies such as CSS, JavaScript, and a proper browser (with an HTML parser), it is capable of so much more than "just being a markup language". In a way, it is the ultimate programming language of UI.
Thank you for this article. It definitely gave me a whole new perspective on this "debate".
Great post. I would call HTML a programming language. It is a simpler one than others, but is a programming language nonetheless. I think the best thing you bring up is the gatekeeping that is so very prevalent in the Developer community. There is a large number of folks who seem so intent on keeping what they do as magical and as mystical as possible in some weird process of keeping their value at the thing they do. But, instead what we should be doing is bringing in everyone who wants to be here. There is so much variety to what code and programming can do that there is room for everyone who wants to learn at all levels. Our value comes from what we can teach others and helping them find ways to express their ideas, not from keeping secrets about our magical processes.
How do you like my joke?
I would consider computation, i.e. transformation of data, as the essence of of a programming language. And the only form of computation, if you will, that HTML is capabale of, is producing constant functions, which, given arbitrary input, will yield a static data structure - albeit one that can certainly be quite complex and very useful.
That being said, that a formal language doesn't constitute a programming language, diminishes its value and importance in absolutely no way. A software system consists of many different artifacts, of which HTML often is an one. And by the way, I also count requirement specifications and user documentation to artifacts that are vital part of a software system. And those are both, at least in most cases, artifacts that, in contrast to HTML, neither follow a formal grammar nor are executable. Computational capabilities the only property that makes something a useful or important.
To conclude, although I disagreeing with the proposed definition for programming language, which is premise of your argument, I indeed very much appreciate the articles sentiment of speaking out against gatekeeping in software development, which in the process of creating a working system isn't useful at all.
I agree, of course it is a programming language. There is not really any counter argument, only convention. The rest is just an inability to understand either English or computers. If someone is not capable of realizing that HTML is used to give instructions then they really need to go off and learn something before engaging in the "discussion" (it is not really a discussion).
To program simply means to provide instructions. It is there staring at you if one takes the time to look at a dictionary (which I am guessing people are failing to do). A program is a set of instructions. HTML is a language used to give instructions... discussion over - it is by definition: a programming language.
Yes, of course mark-up can be used to provide instructions! Is XML a programming language? NO... but the similarity is simply in the way it looks. You are labeling a bunch of values in XML. You are giving instructions with HTML. If I want a load of text to be a heading I "instruct" the browser to do that with h1 or h2 etc...
You need to use a dictionary. None of those bullets are included in the definition of "to program" (but they can be included as examples of things done in programming). What you have done there is akin to looking at a cat and then going: "...right, so animals have 4 legs and fur! The worm clearly is not an animal by this metric."
Markdown is a programming language.