3 ms·
I think this is a bit short-sighted. It's not about Turing completeness. It's mostly about DRY and flexibility. For instance, imagine using theme prefixes or
by jcutrell 13y ago
I think this is a bit short-sighted.
It's not about Turing completeness. It's mostly about DRY and flexibility.
For instance, imagine using theme prefixes or conditionals.
For-loops are fantastic for grid systems.
The point of this article isn't "should you use a pre-processor" - it's pointing to the fact that if you use one, SASS has more natural structures for common tasks like for-loops or conditionals, both of which are indeed useful.
- smrtinsert 13y agoIt's not shortsighted at all. CSS is declarative because if its programmatic, you might as well generate it with a real language.
- jcutrell 13y agoThe same could probably be said of most of the HTML generators out there. HAML, in particular, has a lot of similarities. I agree that programmatic things should be done with programming. I also think that for those who are coming from CSS, the barriers are lower with something that has the shape of CSS. And, the other part of this argument for pre-processors is that they "work." If I were to approach most junior front-end devs with a given programming language versus SASS to generate their CSS, most of them would pick SASS simply because of syntactic familiarity. Not a particularly compelling reason methodologically speaking, but the natural shift does make it a reasonably easy transition from purely declarative to pseudo-dynamic. The purist in me agrees, but the practical implementation says these things are valuable.
- lucisferre 13y agoIt's a superset of CSS language that provides an additional DSL that extends it in a number of ways that provide significant productivity and design benefits. Exactly why would a "real" language make more sense than that?
- mr_luc 13y agoThat might be the opposite of what you want if there's any chance you'll be working with a heterogenous web stack. Define your styling framework in scss, use it from multiple backends. A common case is to share between a static site generator for a public site, and an app framework for the app, which may well be written in different languages.