News for hackers. Stuff that matters.
Re:Why I Write CSS in JavaScript by exogen on Monday February 18, 2019 @12:59PM (#19192640)
Does not classifying it as a programming language help this situation at all?
Re:Why I Write CSS in JavaScript by kazinator on Monday February 18, 2019 @08:58PM (#19196129)
LocalPCGuy may just be responding to the grandparent comment which claims that it is:

> Imagine a programming language that only had global variables. You have to carefully name your variables using complicated conventions in order to avoid any conflicts or unexpected behavior. Even your functions don't have local variables; there is no lexical scoping. Any function can overwrite or mutate what any other function is doing inside. There is no real encapsulation.

That simply isn't true; CSS specifies a bunch of declarative rules, which statically evaluate. Though the evaluator may be stateful, reasoning about how the properties for each document node are determined doesn't require state. It requires reasoning about the targets of the rules, and when they overlap, about their relative scopes and priorities.

Re:Why I Write CSS in JavaScript by exogen on Monday February 18, 2019 @09:46PM (#19196259)
I am the grandparent, and never mentioned anything about state. Not sure why state matters. Declarative CSS rules have effects. The scope of those effects can be both unlimited and unintended, and you can't "opt out" of being affected by rules – if some rule is targeting you, you're out of luck, unless you anticipate it and apply everything with the greatest specificity possible.
Re:Why I Write CSS in JavaScript by kazinator on Tuesday February 19, 2019 @12:01AM (#19196722)
Pardon me; I was thrown off by wording like "overwrite or mutate".