DEV Community

Discussion on: So, how many of you respect CSS as a programming language?

Collapse
 
urielbitton profile image
Uriel Bitton • Edited

This isn't actually a topic for discussion...a programming language in computer science is defined by a technology that is referred to as "Turing Complete". Some examples are classic languages like java, JS, python. I won't go into the long details of a turing compelte language but in basic terms it is a language that can run a 'tape' forward and backwards and possesses the principle idea of The Halting Problem- this means there's no algorithm for determining whether a program will finish running or loop forever. But anyone who knows CSS knows it does not and cannot loop forever and therefore solves the halting problem and so we can conclude CSS is not Turing Complete.

As CSS is not turing complete it is NOT a programming language and should not be respected as a programming language.

Note: i love css and have done amazing things with it so i respect css as a technology but ultimately it isn't a programming language.

EDIT: i definitely DO encourage discussion, that is not what i meant, i simple mean whether it is a programming language or not is not a discussion but a hard fact. Sorry for any misunderstandings!

Collapse
 
fnh profile image
Fabian Holzer • Edited

There are many artefacts that are necessary to create a working software system. I assume we agree, that CSS is indispensable for web applications. I'm not quite sure about the formal properties of CSS with regard to the Chomsky hierarchy. It is a formal language with grammar, semantics and established idioms (and not under-complex). I have read, that some of the recent additions made CSS actually indeed Turing-complete, but I cannot back that up formally.

But allow me to quote the first recipient of the ACM Turing award, Alan Perlis, on this issue of Turing completeness. In a paper collecting epigrams on software engineering, he wrote: "Beware of the Turing tar-pit in which everything is possible but nothing of interest is easy."

I personally have a whole lot of respect for those who actually master CSS (I don't count myself among them). Since I expect the web as an application platform to stay around and thrive for quite a few more years, I think any person who is able to write good CSS will not be out of work anytime soon.

Collapse
 
kallmanation profile image
Nathan Kallman

CSS is turing complete so.... even by your definition it is a programming language.

Collapse
 
urielbitton profile image
Uriel Bitton

It is not turing complete. If you read my comment, i prove it solves the halting problem, therefore by deduction it is not turing complete...

Thread Thread
 
kallmanation profile image
Nathan Kallman

CSS can encode Rule 110
Rule 110 is known to be Turing complete
QED: CSS is Turing complete


To comments about halting; to actually "compute" in CSS requires "pumping" (clicking or key taps). This is not substantively different than the "pumping" a clock does to our computer chips (they just do it "automatically"). Yes CSS will halt for any given execution cycle between these "pumps"; but comparing that to the halting problem in general means that I can argue our CPUs are not Turing complete because they are guaranteed to complete execution of any single instruction. If CSS is not Turing complete neither is my computer and by extension any programs executing on it.

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

Try scrolling down to the second answer on that SO question; it makes a fairly good argument for why CSS isn't turing-complete at all.

Thread Thread
 
urielbitton profile image
Uriel Bitton

But that's exactly what i'm saying as well haha

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

a programming language in computer science is defined by a technology that is referred to as "Turing Complete"

And who exactly is "computer science"? I agree that CSS is not a programming language, but not because some magic CS authority claims it to be. Everyone in this community is to some extent part of CS and has an influence over the language we use.

This isn't actually a topic for discussion

It very much is, precisely because the CS community seems to be quite split on this question.

But anyone who knows CSS knows it DOES solve the halting problem and so we can conclude CSS is not Turing Complete.

This is a smaller nitpick, but CSS doesn't "solve" the halting problem; it's that the halting problem doesn't exist for CSS because it is, as you've pointed out, not turing-complete.

[CSS] should not be respected as a programming language.

That phrasing is a bit ambiguous. I'd say CSS should not be respected for being a programming language (because it isn't), but it should be respected just as any programming language would.

Ultimately, being turing-complete is a very technical way for classifying languages, but it doesn't tell us how difficult or powerful it is.

Collapse
 
urielbitton profile image
Uriel Bitton • Edited

It is not some magic authority on CS that claims this. This is a fully accepted concept by EVERY computer scientist in the world..
If the halting problem doesn't exist for CSS that makes it non turing complete as well.

It does not need to tell us how powerful it is (eventhough it is) it is simply about being turing complete or not, power is irrelvant here.

Collapse
 
trueneu profile image
Pavel Gurkov

That's not exactly how science works. Not everyone in this community is a part of Computer Science. I think I can safely assume most of us aren't. The same as talking about quantum mechanics doesn't make me a part of Quantum Physics as a scientific field. Publishing high quality white papers in a peer-reviewed science journal, on the other hand, kinda goes hand in hand with scientific method.
The fact that the community is split on this question shouldn't matter. Some people still question special relativity, or general relativity, or think that the Earth is flat. Does this change anything regarding those theories itself?

Thread Thread
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

I think I can safely assume most of us aren't

You're saying a community called "dev" is mostly visited by non-developers? You realize terminology isn't unilaterally decided by academia, right? Whether you're "just" a javascript developer, or a researcher who's written 10 books makes no difference here.

Thread Thread
 
trueneu profile image
Pavel Gurkov
  1. I wasn't saying anything about developers or non-developers. I was saying on being part of CS. Let me try a different example: writing fan fiction doesn't make you a part of literary theory.
  2. Terminology is decided by someone or something, whether it's academia or not, and if we do not define a term in a clear, non-amibguous way, we cannot use it. Which term are you talking about?
  3. When you say it makes no difference here, which here do you mean? Do you mean this community? Or this discussion? Or do you mean that CSS being a programming language is a question we should vote on, and it doesn't matter who the vote comes from?

I'm sorry, but it does make difference to me. To each and any sentence I will apply my critical thinking, and I always leave the possibility that a neophyte is brighter than Edsger Dijkstra. However, the probability is quite, quite low.

Collapse
 
collingskenny profile image
Kenny Collings • Edited

I do not think a programming language needs to be turning complete. In fact, I don't think "computer science" defines what a programming language is.

Computer science, however does define a formal language. From the bible of computer science, Introduction to Algorithms, "a language L over [an alphabet] is any set of strings made up of symbols from [that alphabet]." Basically, any series of words made using a defined set of letters is a language. This is incredibly broad. A language can include everything from the null language (a language of nothing), to turning complete languages, to even human languages like english. In automata theory, the simplest languages defined is the language of a DFA, or a regular language. DFAs, by definition, do not have to be turning complete.

If however, we want to define what a programming language is we have to go broader. From the bible of the internet, Wikipedia, "A programming language is a formal language comprising a set of instructions that produce various kinds of output." By this definition CSS IS A PROGRAMMING LANGUAGE. It is a formal language (see definition above) and it's set of instructions provide an output that shape the web in beautiful ways.

From my understanding of computer science, turning completness is a descriptor of some programming languages, not the other way around. Programming languages come in all shapes and forms, from regex to javascript, from html to scratch.

I am far from an expert in this field, and this is my interpretation and understanding of mathematics, so please correct me where I am wrong! Programming languages are really cool and I think it is amazing that computer science is really just an offshoot of linguistics! 😁 Have a nice day!

Collapse
 
ajxn profile image
Anders Jackson

About the first definition about formal language.

Not all languages are computer languages, even if they fall in that definition like HTML or regular expressions. Nor is grammar like LR(1) or LL(n) grammars, even if they can be used to define grammar of programming languages.
You see, DFA and grammars are important tools to make usable programming languages.
And all languages doesn't need to be abel to be described with DFA and with grammars. Like FORTRAN IV.

DFA and grammars and HTML and CSS are still not part of the sub group of languages that is programming languages.