DEV Community

Discussion on: Of course HTML is a programming language

Collapse
 
kenbellows profile image
Ken Bellows

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.

  • Function calls - It's been argued before that HTML tags and CSS rules could both be considered function calls, as they both instruct the computer to execute some previously defined code.
  • Logic - CSS has various conditional operators, e.g. @media queries, :nth-child() selectors, etc.
  • Change the flow of execution - This is more questionable, but similar to the previous point, I'd argue that @-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 native goto in many classic languages, e.g. JavaScript, Haskell, Prolog, and many Schemes. If you didn't mean a literal goto, but rather anything that allows moving to another bit of code at will, then how does this differ from the function call rule?