17

Possible Duplicate:
Why does it matter that HTML and CSS are not programming languages?

As I understand a programming language is something that can be used to solve a problem/perform an alogrithm. Then someone just said to me "I programmed a website using HTML, JavaScript, and CSS", and my immediate reaction was HTML and CSS are not programming languages, then remembered the L in HTML means Language. But still it is a "Markup Language".

So are CSS and HTML programming languages? If they are they can't be in the same boat as languages like C. In languages like C the order of instructions is crucial, but in CSS you can have rules and selectors in any order, and in HTML the order of the tags matter, so there must be some sub-classification of languages, where CSS/HTML/similar are in one and C/Python/etc are in the other?

Jonathan.
  • 880

4 Answers4

28

Technically yes, but it wasn't really designed to be one.

CSS+HTML actually is turing complete because you can encode Rule 110 in CSS.

That said, it would be prohibitively impractical to try to write programs in HTML and CSS.

People who say they program in HTML are generally mistaken about programming. HTML is a markup language and CSS is a style sheet language. HTML is designed to store content hierarchically and CSS is designed to customize how the content is displayed. HTML and CSS are meant to express presentation, whereas code typically is written to do something, that is, to have some sort of function.

Peter Olson
  • 1,062
4

No, CSS is a style sheet language which describes the appearance of markup (text with contextual definitions called "tags"). I've never met an experienced programmer who considers CSS/HTML programming languages. Doesn't mean you can't do cool stuff with them (especially HTML5/CSS3), but they don't particularly, logically instruct the computer to perform specific calculations and operations.

Matt
  • 409
2

No: (as I understand this), absence of for/while loops and if statements. Generally when "programming language" is mentiones, means Turing complete Programming language, one link here.

CSS, XML (therefore HTML) are markup languages.

2

Cascading-Style Sheet or CSS is not a programming language. It is a mark up language used with HTML to design the user interface of a website (the style is applied to the mark up language through out the same sections of similar parts).

Programming languages have the ability to perform algorithms to calculate equations or perform low level machine based operating instructions and tasks.