3 ms·
Why should I use C since I already know Assembly? Why should I use Ruby since I already know C? Haml and Sass are elegant tools for simplifying view code, and
by aaronbrethorst 17y ago
Why should I use C since I already know Assembly? Why should I use Ruby since I already know C?
Haml and Sass are elegant tools for simplifying view code, and I never, ever use ERB or CSS anymore if I can avoid it.
- jherdman 17y agoMy biggest qualm with Sass is that it introduces a speed bump in my workflow compared to using plain CSS. This is due to the fact that I can use tools like CSS Edit to create, edit, and verify my CSS all at the same time. If these tools also supported Sass I'd be all set.
- aaronbrethorst 17y agoAlthough it doesn't satisfy your 'no speed bump' test, you could still generate css files with CSSEdit and then convert them to Sass with css2sass. Certainly inelegant, but it could cut it. Also, just out of curiosity, why do you use CSSEdit? I'm guessing you probably write your HTML or Haml markup with Textmate and not Dreamweaver, right? Why do something different with CSS?
- jherdman 17y agoCSS Edit gives me instant feedback on my changes. It's not always easy to know how changes to your CSS will display. You have to think about all the rules that are in play, as well as the defaults of a given browser. HTML is much easier. You're just dealing with structure, so it's much easier to comprehend.
- ThinkWriteMute 17y agoMy biggest problem with SASS is that it's turned into a full on programming language.
- nex3 17y agoThis is an odd meme, and not really accurate. Yes, Sass has a few control structures that are not meant to be used in day-to-day stylesheet coding. But the language is wholly geared towards creating stylesheets, and every feature was added with that in mind. It doesn't contain any programming features for the sake of having programming features. Incidentally, it's also not Turing-complete.
- ThinkWriteMute 17y agoI'm pretty sure it is Turning-Complete, and it's something they were heralding a few weeks back. Their goal is to be a programming language. Wikipedia: After its initial versions, Nathan Weizenbaum and Chris Eppstein have continued to extend Sass with SassScript, a Turing Complete scripting language used in Sass files. and http://wiseheartdesign.com/articles/2010/01/18/the-demise-of-css-why-sass-and-languages-like-it-will-triumph/ http://wiseheartdesign.com/articles/2010/01/18/the-demise-of...
- chriseppstein 17y agoYou're replying to the guy who writes Sass. He's right. It's not actually turing complete, but it could be made so with a relatively minor change. And I'm the guy who invented most of the programming facilities of Sass and I'll tell you, they're not very good programming tools -- but they're enough to make some really great stylesheets.
- nex3 17y agoIn order to be Turing-complete, Sass would have to have some way of reading and writing arbitrary amounts of memory. Since it has neither anonymous functions nor any sort of data structures, it can only read and write from pre-declared variables.
- nex3 17y agoWe've tried to get the CSSEdit folks to support Sass, but so far they haven't been interested. I think the best way to get that is to have more users say they want it.
- alextgordon 17y agoI would guess that such a change would be too big to be economically viable. Sass would require a rewrite of all the parsing code, and a redesign of the GUI CSS editor. Unless Sass gains a considerable market share among Mac users, I doubt it'll happen. You're better off trying to convince them to include the necessary hooks in Espresso, if they add CSSEdit-style functionality to it.
- derefr 17y agoActually, I think you've got something interesting mixed into that comparison: assembler. SASS/HAML aren't like a high-level programming language like C or Ruby, because there's really just not that much translation going on. They're more like assembler: a one-to-one mapping of machine language that makes it easier to read and work with.
- nex3 17y agoSass (not Haml) allows you to work at a significantly higher level than CSS. The parallel in programming languages might be Forth: the basics translate directly, but using the abstractions provided by the language you can make it work at a much higher level. In the case of Sass, abstraction is primarily provided by mixins and functions. Compass (http://compass-style.org http://compass-style.org) provides an excellent example of using these to write CSS at a much higher level.
- jamesbritt 17y ago"Haml and Sass are elegant tools ..." But that's the whole discussion right there; not everyone sees them as elegant, and simply asserting them to be so is not an argument.