r/ProgrammerHumor • • Jun 01 '23

Meme HTML is not a programming language

Post image
9.1k Upvotes

500 comments sorted by

View all comments

1

u/SillAndDill Jun 01 '23 edited Jun 02 '23

For traditional reasons let's continue to distinguish between markup and programming.

But let's not be snobbish and act like html is entirely different and can't handle any logic at all.

SrcSet is a good example.

SrcSet in html is basically declarative programming with a set of conditions that are equivalent to:

"if window width < 500 then img.src=small.jpg; else if window.width < 800 then img.src=big.jpg; else img.src=biggest.jpg;".

So don't treat HTML as unworthy. In some cases HTML alone can solve complex tasks