loading...

Discussion on: Are CSS and HTML programming languages?

Collapse
jasperhorn profile image
JasperHorn

I know this post is pretty old, but this site keeps linking me to it and since I disagree with the bias in the question, I get the urge to write a response every time. I finally gave in.

No, I don't think html and css are programming languages. I also don't consider it gatekeep-y to say this. That's because I don't think they're less than programming languages, and saying they aren't programming languages changes that. Well, saying it out of the blue may imply that they're less, so that can be gatekeep-y. Saying it when the question is whether they are programming languages isn't. Neither is saying it when asking someone for their programming experience in order to determine the level at which you're going to explain them about something (though I'd probably make it "aren't really programming languages").

I consider programming to be about instructing a computer what to do. I do realize that html and css together are often seen as a way to tell the computer what to display on the screen (where displaying on a screen is definitely a subset of doing) but I don't think that's what they are really about. Html is about giving structure to a document. A good html document can be read by a screen reader which doesn't display things at all. Css is about establishing how you want your structures to be displayed. Good css has very little specific to a single page and has a lot that can be reused. It's more about adding your style to your site than about telling the computer what to put on the screen. At least in theory, in practice it's often less clear-cut.

Personally, I do both write html & css and program in what I consider programming languages and I like both. They feel like different activities to me, though. The difference between programming in one language and programming in another language is much smaller in my opinion, even when the one language is imperative and the other is functional.

I do have one experience writing css that felt like programming, though. I was using very recursive css to display a family tree. However, that was not at all a way in which css is typically used, I feel it was more coincidence than intentional that css could do this at all and it was not at all how it is meant to be used. The result was still really awesome, though.