this post was submitted on 06 Mar 2024
519 points (96.1% liked)

Programmer Humor

31812 readers
255 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 3 points 5 months ago* (last edited 5 months ago) (3 children)

I'm not a programmer so I'm tending towards accepting HTML as a programming language, because it's a language you type in to make the computer do stuff. Is there maybe another example of something that does what HTML does but obviously isn't a programming language?

[–] pancakes 5 points 5 months ago (1 children)

Markup language vs programming language is similar to the difference between a font and a typeface. Sure, they're different but to the layperson, they might as well be the same thing.

[–] [email protected] 1 points 5 months ago

But a font is an instance of a typeface, so you just mean they're different gestalts? My question was how they're different things.

[–] labsin 5 points 5 months ago* (last edited 5 months ago) (2 children)

A PowerPoint, word document or even a text file or picture. There is only a description in the file of what it holds and it's up to the program that reads it, how it will visualize or interpret it.

A word document or PDF would be the closest.

[–] [email protected] 2 points 5 months ago (1 children)

To be fair to PDFs, they can contain JavaScript. Blame Adobe for that and their originally-exclusive-to-Acrobat extension for that.

[–] labsin 2 points 5 months ago

A word document can also contain a script, as can html pages. It's why I thought these two were the closest match. Nobody is going to call those programming languages.

[–] [email protected] 1 points 5 months ago (1 children)

You mean the code behind the scenes is like HTML? But then I don't see how it's not in a programming language.

[–] labsin 1 points 5 months ago (1 children)

No, the html file itself. It just contains elements like a paragraph, image, list, table,... just like a word document.

[–] [email protected] 1 points 5 months ago (1 children)

So you mean for example that typing ... is more comporable pressing enter in Microsoft Word? But then you're typing a code instead, no?

[–] [email protected] 2 points 5 months ago (1 children)

Yes, typing in HTML is like pressing enter in word, but that doesn't make it a programming language, it makes it a markup language.

A markup language is also what you can use to format comments here: You use a specific syntax to indicate how you want things formatted.

The separation from a programming language is that a programming language can be used to implement logic, like saying: In the following paragraph, a word should be bold if it contains the letter "A". That cannot be done with a markup language.

[–] [email protected] 1 points 5 months ago

Okay, I follow now. Thanks for your patience, ha.

[–] [email protected] 1 points 5 months ago

A markup language (which is what HTML is) is like an advanced text container. When you write a post or comment here, you can use specific syntax to indicate the size of the text, a hyperlink, a quote, etc. HTML is that. It doesn't "do" anything, you're just writing in what you want it to display, and that is displayed.

A programming language lets you somehow "do" something. Instead of declaring explicitly "write this text in bold" a programming language can be used to process all the text in an arbitrary document, and change the word "aeroplane" to bold whenever it turns up. That is: The output from the code isn't just a rendering of what is explicitly written there, which is what a markup language gives you.