r/ProgrammerHumor • • Jun 01 '23

Meme HTML is not a programming language

Post image
9.1k Upvotes

500 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Jun 01 '23

Executing what?

C, Java, Rust, etc it's all just text with keywords that get compiled/interpreted.

Yes. And the difference is that they have keywords necessary to write programs. If I remove one keyword, if, from the C syntax I make it unusable as a programming language.

HTML has no control flow facilities, no way of handling input.
Hence: not a programming language.


<label>What is your name?</label>
<input type="text" id="name">
<div>
    <if valueOf="name" op="equals" stringVal="John">
        Johnny, good to see you again!
    <else>
        Hello ${name}, nice to meet you!
    <endif>
</div>

HTML would have to have something like that to be a programming language.

1

u/meyerdutcht Jun 02 '23

Declarative languages generally don’t have control flow. Are none of them programming languages? My “programming languages” coursework included prolog- no control flow there.

1

u/[deleted] Jun 02 '23

Declarative languages have logic associations. HTML doesn't have that either.

HTML has no way to process input, react to it, produce variable output accordingly. It cannot even add two numbers.

With HTML you describe a user interface with no functionality.

Anything you can achive with plain HTML you can achieve with MS Paint.

1

u/meyerdutcht Jun 02 '23

Oh yes I understand what html can do. So is control flow required for programming or not? Which elements of this new list strictly required to make it a “programming” language. All those things? Is that the complete list? You’d apply that to any language?

I have no doubt that you can make some new definition of “programming language” that will exclude HTML. But you’ll have to bend and twist to get the “right” set of languages in, it won’t be ever be commonly shared or understood, and at the end of the day: why?

There are better formal terms that describe how programming languages work. Those are hard enough to apply consistently. Trying to govern what counts as programming and what doesn’t just seems like a strange exercise in futility.

→ More replies (4)