4 ms·
No, I think you're wrong. It's not for everyone but I highly recommend you look into one of these. I'd say look at LESS or SASS (they're basically the same) bec
by billpatrianakos 15y ago
No, I think you're wrong. It's not for everyone but I highly recommend you look into one of these. I'd say look at LESS or SASS (they're basically the same) because that's what I'm most experienced with. Here's why it makes sense to use these languages:
First off, these languages help you write faster, and more efficiently. They mostly take a lot of the repetition and mental strain out of writing code. In my experience with LESS I'm always able to do things faster and don't have to remember color names or keep track of certain styles that I repeat many times especially if they include vendor prefixes.
Then once you've "compiled" the code it's the same as if you were to write it normally. Some may say "so what's the point then?" but again I must repeat that you are able to work more efficiently and still have yourself normal, totally compatible CSS, js, or HTML.
As far as performance goes, there really is no loss in performance as your abstracted code is compiled to the everyday kind with option to minify it too. I use LESS for all ky styling and on my Mac I use either Less.app or CodeKit which automatically detects changes to my .less files and compiles them on the fly to normal .css ones. The source of every page always asks for normal .css files and I really don't have to do any extra work besides making sure the app outputs my stylesheets in the right folder. As a bonus, CodeKit also minifies most languages, detects and syntax errors, and does some image optimization. On my Linux box, I just run a quick terminal command and the compiling takes a couple seconds. Barely any extra work at all.
The only time I'd see ant performance issues is if you were doing client or server side parsing/compiling of these abstraction languages in production. For example, you can use less.js and have your .less files linked in your HTML and it'll turn it into CSS on the fly. That would be a problem. Otherwise, as long as you're taking your HAML, CoffeeScript, LESS/SASS/SCSS, and whatever else and converting it to everyday js, CSS, and HTML then you have nothing to lose and everything to gain.
I used to believe like you that these superset languages were just a novelty and had no truly useful purpose. Then I tried LESS and still thought it was lame for a short time (I only grasped the concept of variables and thought the only benefit was being able to name colors) until I really understood it and now I can't live without it. Give one of these a try and I think you'll appreciate them.
Edit: I understand that not all of these work the same. For those that require server or client side parsing with no option to convert prior to production then you have a point. But most of these abstracted, superset languages can be compiled to normal CSS/HTML/js before production and those are the ones that are truly beneficial.