Table of Contents
"HTML is a markup language, not a programming language"
"HTML has no logic"
"HTML is not 'Turing-complete'"
So, is HTML a programming language?
Home Web Front-end CSS Tutorial HTML is Not a Programming Language?

HTML is Not a Programming Language?

Mar 21, 2025 am 09:52 AM

HTML is Not a Programming Language?

HTML is not a programming language.

I have heard this sentence countless times, it is boring. Often, it's followed by words like "it has no logic" or "it's not Turing-complete"...so, obviously it's not a programming language. It seemed as if things were over and the discussion should stop.

But should it really be like this?

I want to explore the arguments I often hear to devalue HTML and make my own rebuttals to show that these statements are not entirely correct.

My goal is not to prove that HTML is or is not a programming language , but to show that the three main arguments used to claim that it is not a programming language are flawed or incorrect, thereby invalidating the conclusion from a logical point of view.

"HTML is a markup language, not a programming language"

The statement itself sounds good…but it is wrong: a markup language can be a programming language. Not all markup languages ​​are (mostly not), but they can be. If we draw a Venn diagram of a programming language and a markup language, it will not be two separate circles, but two slightly intersecting circles:

A markup language that uses variables, has control structures, loops, etc., or may be a programming language. They are not mutually exclusive concepts.

TeX and LaTeX are examples of both markup languages ​​and programming languages. Developing with them may not be practical, but it is possible. We can find some examples online, such as the BASIC interpreter or the Mars rover controller (which won the jury award in the 2008 ICFP Programming Competition).

While some markup languages ​​may be considered programming languages, I'm not saying HTML is one of them. The key is that the initial statement was wrong: the markup language can be a programming language . Therefore, saying HTML is not a programming language because it is a markup language, is based on a false statement, and any conclusions you draw from this premise will be absolutely wrong.

"HTML has no logic"

This statement requires us to clarify the meaning of "logic" because the definition may surprise you.

Like Turing Completeness (which we will definitely talk about soon), the person who made this argument seems to misunderstand its exact meaning. I've asked people to tell me what they mean by "logic" and got some interesting answers below:

Logic is a reasonable way of reasoning or thinking.

This is fine if we are looking for a dictionary definition of logic. But we are talking about programming logic, not just logic as a general term. I also received answers like this:

Programming languages ​​include variables, conditions, loops, etc. HTML is not a programming language because you cannot use variables or conditions. It has no logic.

This is good (and certainly better than going to true/false/and/or etc), but it is also wrong. HTML does have variables—in the form of attributes—and these variables/attributes and control structures can be used to determine what is displayed.

But how do you control these variables? You need JavaScript!

Error again. Some HTML elements have internal control logic and do not require JavaScript or CSS to work . I'm not talking about it<link> or Something like that—they are basic control structures that have been part of the standard for decades. I mean those elements that respond to user input and perform conditional operations based on the current state of the element and the value of the variable. by <details>/<summary></summary></details> Tuple or<dialog></dialog> Elements are examples: When the user clicks them, they will be closed if the open attribute exists; if not, they will be open. No JavaScript is required. So simply saying HTML is not a programming language because it lacks logic is misleading. We know that HTML is indeed able to make decisions based on user input. HTML has logic, but it is essentially different from the logic of other languages ​​designed to manipulate data. We need stronger arguments than this to prove that HTML is not a form of programming.

"HTML is not 'Turing-complete'"

OK, this is the argument we see most in this debate. Technically (the best kind of correct), it is correct to say that HTML is not Turing-complete, but this should spark a bigger debate than just using it as an end statement.

I won't go into the meaning of Turing completeness, as there are a lot of resources on this topic. In fact, Lara Schenck sums this up well in one of her articles that argues that CSS is Turing complete:

Simply put, for a language or machine, Turing perfection means that it can do what the Turing machine can do: perform any calculation, that is, general calculation . After all, programming was invented to do math operations, and of course, we are doing more with it now!

Because most modern programming languages ​​are Turing-complete, people use it as the definition of programming languages. But Turing completeness is not the case. It is a standard for identifying whether a system (or its rule set) can simulate a Turing machine. It can be used to classify programming languages; it does not define them. It doesn't even work only in programming languages. For example, the game Minecraft (meets this standard) or the card game Magic (also meets this standard). Both are Turing-complete, but I doubt anyone would classify them as programming languages.

Turing completeness is now popular, just as some people used to think that the difference between compiled and interpreted languages ​​was a good standard. Yes. We don't have to worry about it when developers (mainly backends) underestimate front-end programming (including JavaScript and PHP) is not "real programming". You still hear it sometimes, even though it is now faded, vague, whispered.

The definition of programming (or not) changes over time. I bet someone sorting out piercing cards would complain that typing code in assembly language is not real programming. There is nothing universal or written on stone. There is no actual definition.

Turing completeness is a fair criterion, I must say, but it is biased and subjective – not in its form, but in its way of choosing. Why is one language that can generate Turing complete machines considered a "programming language", while another language that can generate finite state machines does not? This is subjective . This is the same excuse for anyone else to distinguish between "real developers" (those who make this statement) and those who are not as good as them.

To make matters worse, it is obvious that many people who repeat the "HTML is not Turing-complete" spell do not even know or understand what Turing-completeness means. It is not an award or a mark of quality. It is not a badge of honor. It's just a way to classify programming languages ​​- group them instead of defining them. A programming language can be Turing-complete or not, just as it can be interpreted or compiled, imperative or declarative, procedural or object-oriented.

So, is HTML a programming language?

If we can devalue the main arguments that claim HTML is not a programming language, does this really mean that HTML is a programming language? No, that doesn't mean it. Therefore, this debate will continue until HTML standards development or the "current definition" of programming languages ​​changes.

But as developers, we must be wary of this issue because in many cases it is not used to inspire serious debates, but to stir controversy while hiding subterrior motives: from gaining a relaxed internet response to dangerously reducing a group of people’s contribution to the development ecosystem.

Or, as Ashley Kolodziej summed up brilliantly in her ode to HTML:

They say you're not a real programming language like other languages, you're just markup languages, and technically, I guess that's right. Technically, JavaScript and PHP are scripting languages. I still remember that understanding JavaScript wasn't cool at that time, and it wasn't a "real" language either. Sometimes, I find these differences meaningless, like we created a vocabulary to hinder you (and ourselves as developers). You, as a markup language, have your unique value and advantages. Knowing how to best use you is real expertise that often gets overlooked.

Whatever our position on the discussion of "HTML is/is not a programming language", let's celebrate it without denying its importance: HTML is the backbone of the Internet. It is a beautiful language with a lot of documentation and extensive grammar, but it is so simple to learn in an afternoon and so complex that it takes years to master. Whether it is a programming language or not, what really matters is that we have HTML.

The above is the detailed content of HTML is Not a Programming Language?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Working With GraphQL Caching Working With GraphQL Caching Mar 19, 2025 am 09:36 AM

If you’ve recently started working with GraphQL, or reviewed its pros and cons, you’ve no doubt heard things like “GraphQL doesn’t support caching” or

Building an Ethereum app using Redwood.js and Fauna Building an Ethereum app using Redwood.js and Fauna Mar 28, 2025 am 09:18 AM

With the recent climb of Bitcoin’s price over 20k $USD, and to it recently breaking 30k, I thought it’s worth taking a deep dive back into creating Ethereum

Vue 3 Vue 3 Apr 02, 2025 pm 06:32 PM

It&#039;s out! Congrats to the Vue team for getting it done, I know it was a massive effort and a long time coming. All new docs, as well.

Creating Your Own Bragdoc With Eleventy Creating Your Own Bragdoc With Eleventy Mar 18, 2025 am 11:23 AM

No matter what stage you’re at as a developer, the tasks we complete—whether big or small—make a huge impact in our personal and professional growth.

Can you get valid CSS property values from the browser? Can you get valid CSS property values from the browser? Apr 02, 2025 pm 06:17 PM

I had someone write in with this very legit question. Lea just blogged about how you can get valid CSS properties themselves from the browser. That&#039;s like this.

A bit on ci/cd A bit on ci/cd Apr 02, 2025 pm 06:21 PM

I&#039;d say "website" fits better than "mobile app" but I like this framing from Max Lynch:

Comparing Browsers for Responsive Design Comparing Browsers for Responsive Design Apr 02, 2025 pm 06:25 PM

There are a number of these desktop apps where the goal is showing your site at different dimensions all at the same time. So you can, for example, be writing

Stacked Cards with Sticky Positioning and a Dash of Sass Stacked Cards with Sticky Positioning and a Dash of Sass Apr 03, 2025 am 10:30 AM

The other day, I spotted this particularly lovely bit from Corey Ginnivan’s website where a collection of cards stack on top of one another as you scroll.

See all articles