3 ms·
It's a throwaway comment in the article, but I feel it's important to push back on: HTML is very definitely a programming language, by any reasonable definition
by andrewaylett 8mo ago
It's a throwaway comment in the article, but I feel it's important to push back on: HTML is very definitely a programming language, by any reasonable definition of "programming language".
Edit to add: It might not be an imperative language, but having written some HTML and asked the computer to interpret it, the computer now has a programmed capability, determined by what was written, that's repeatable and that was not available apart from the HTML given. QED.
- zem 8mo agoagreed, it's a hill i am very willing to die on too.
- mr_00ff00 8mo agoSo is Markdown a programming language? Any logic for html, is therefore Markdown as well.
- zem 8mo agosure, it's a dsl for generating formatted output
- Dylan16807 8mo agoIf we trim markdown to just italic, bold, and underline, is it still a programming language? What if we trim even further, to just the ASCII control codes? My newline characters make the computer perform a special action to generate formatted output. Is that programming?
- zem 8mo agoif we trim a regex down to literal character matches is it still a regex?
- imtringued 8mo agoSo any text file is a programming language?
- andrewaylett 8mo agoI would say that a "language" is a necessary component of a "programming language". An empty file was an IOCCC winner: https://www.ioccc.org/1994/smr/ https://www.ioccc.org/1994/smr/ but you need to interpret that empty file as C source in order to reasonably claim to have programmed the computer. My reasoning comes more from the other direction: someone who writes HTML is programming therefore HTML is a programming language.
- Dylan16807 8mo agoCan you give a clearer definition of when a person "is programming"? Your earlier definition talked about giving the computer a capability, but that capability just seemed to be displaying a specific file? Where is the cutoff on the line from HTML to markdown to ASCII? (noting that ASCII uses control codes that trigger special behavior)
- andrewaylett 8mo agoHonestly, I don't think there's a bright line. What's the difference between "code" and "data"? It's as much about intent as anything. If my focus is on my content then I'm probably not programming. But if my focus is on getting the computer to do something then I probably am, even if the end result is identical. I've created any number of empty files in my lifetime, and I wouldn't say that more than a couple of them were programming, but I don't think it's controversial to claim that the IOCCC submission I linked up-thread definitely was programming, and (maybe slightly more controversial) that my deliberate replication of the program when I first heard about it $mumble years ago was also programming? In your specific example, if someone constructed an ASCII file which made use of the control codes to do something interesting (or even something boring!) then wouldn't that be programming? While typing ASCII into this text field isn't programming because the value of the information is in the human interpretation of the content rather than the machine having interpreted the content as code.
- tracker1 8mo agoHow would one do an if condition or enumerate a list in HTML alone? For that functionality you need another language to generate/manipulate the HTML.. not to mention interpreting HTML for display. HTML is a markup language, it's even in the name... but it's not a complete programming language by any stretch.
- andrewaylett 8mo agoIt's not Turing-complete, and as you say, it's a markup language and it's not general purpose. But neither is a necessary component of "programming language".
- Dylan16807 8mo agoIfs and enumerations are a simpler requirement than Turing completeness. They're an even more basic version of giving the computer logic to evaluate.
- tracker1 8mo agoExactly... it's pretty much what I consider the minimum for a "programming language" is that you need to be able to have basic state and be able to make use of state. For that matter, it wouldn't take much to get HTML to have those features... though the DOM, JS and even WASM do so well, we don't need it generally speaking.
- Dylan16807 8mo agoPlease explain how your edit doesn't apply to a .txt file
- pie_flavor 8mo agoHTML requires you to understand symbolic representations, where <> means something special. It is more verbose, but no more structurally complex, than Markdown. It does not require you to understand imperative dynamic logic. Getting the hang of symbolic representations is easy, and getting the hang of imperative programming is very hard and most people can't do it. That's why the dividing line is where it is. Making a static bulleted list isn't a 'capability' in HTML if you weren't thinking it was one in Markdown, and inventing your own precisely crafted definition with no purpose other than to include HTML then calling all others unreasonable doesn't convince anyone.