4 ms·
It's probably just me but I don't use libraries and secondary "languages" that compile to another language (in web development context). So no jquery, coffeesc
by Achshar 14y ago
It's probably just me but I don't use libraries and secondary "languages" that compile to another language (in web development context). So no jquery, coffeescript, SASS, LESS, pIE etc. I don't feel satisfied when my code's efficiency/speed depends on some one else's code. It somehow means i am not in full control of things. I like to keep dependencies to a minimum. Which basically means I don't want to include any files in my webpage that are not written by me. (Google Analytics is an exception though)
It's kind of an obsession really, to the point that I furiously try not to use any third party library unless absolutely needed. And I haven't needed one until now. And I have also yet to regret these decisions.
- TazeTSchnitzel 14y agoI use CoffeeScript, but I'm reluctant to use SASS or LESS, since they are ugly and I generally want to avoid having to use software to manipulate my HTML/CSS content. I'm fine with JS, but I like my compile script only having to copy my index.html and style.css file across, not having to invoke a CSS compiler.
- Achshar 14y agoThe CSS compilers really dont make much sense to me. The language is very easy/simple as is (vendor prefixes are a mess though) and having a compiler's overhead on every request does not feel right to me. I love JS though, in fact it's my favorite go to language for all kinds of work, heavy duty or light. I thinks that is also a part of the reason I am not inclined towards languages that compile to JS, they kind of destroy the experience of writing JS, which I am very fond of.
- TazeTSchnitzel 14y agoWhat request overhead? I thought people used them when developing and pushed the compiled result to the server. And I love JS too, but I use CoffeeScript since it's basically syntactic sugar for JS that saves me some keystrokes and makes my code more readable.
- Achshar 14y ago> I thought people used them when developing and pushed the compiled result to the server. Oh well, i see, that makes sense, but as i said i don't use them so i don't know very much about them. I probably should use them once just for the sake of checking them out. And coffeescript too. Thanks!
- duskwuff 14y agoIf you're running the LESS compiler on every request, you're doing it wrong. Doing that might make sense in development, but for deployment you're expected to run the compiler once to generate a single static, minified CSS file. Same as JS compilers/minifiers in that respect. As far as what these compilers do? Yes, CSS is nice enough as it is; that's why these compilers don't mess with the syntax too much. Most of what they're useful for is acting as a macro preprocessor (so you can use @color macros and automatically generate vendor prefixes, for instance), as well as for efficiently combining multiple source files. If you're not familiar with how useful CSS compilers like LESS can be, I'd highly recommend that you take a look at Twitter Bootstrap. They use the macro-processing features pretty heavily, and to impressive effect. For instance, most of the colors in a Bootstrap site are configured in variables.less -- including light/dark color variants! -- so you can change around the whole color scheme of a Bootstrap site by adjusting just a few color definitions.
- Achshar 14y ago> you're expected to run the compiler once to generate a single static, minified CSS file. Yes, i stand corrected on that, i don't use them but that is not an excuse for ignorance. Plus compiling once makes more sense than compiling every time. I also use webkit's web inspector for making live changes to a stylesheet and then saving the file in the end, very convenient compared to the changing-saving-uploading-refreshing cycle. Also it is another barrier to entry for my open source project. (someone has to know all the compiling process to contribute) And as for uses of compilers, with CSS variables at the horizon (already functional in chrome canary IIRC) and other than this vendor prefixing problem (which everyone knows is very real and seeing the rapid release cycles of all major browsers now days, it is not far fetched to see a solution being cooked up some time soon) compilers don't have much to tackle. The cost v/s return ratio will reduce and probably even be negative in near future (if not already). The cost is of compiling every time during development and once every time production code changes. I don't know about you, but if i am not live editing css in web inspector, i make a ton of very small changes to CSS and try them out one by one by refreshing the page. Not a great experience if i have to go to command line every time i change a byte. > Efficiently combining multiple source files. This problem can only arise in very big projects and if your project is in that category then there are all sorts of solutions available. (including writing your own compiler) But if that problem exists in a small or even middle sized project, them i believe, the solution is not the compiler but to re-factor the code base to use less files or merging them.
- Natsu 14y ago> The CSS compilers really dont make much sense to me. CSS doesn't have variables. I can change my site's color scheme by changing just a few variables. (And I need to, too, because I'm not exactly great at picking them out in the first place...)
- pepve 14y agoYou must be a rich man. I don't have the time or money to exclude everything that's Not Invented Here.
- Achshar 14y agoYes, I see your point. Re inventing the well makes no sense, i agree whole heatedly. But the fact is i never had to reinvent the wheel, outside of the prefixing madness. I kind of hate jquery. It used to be very useful back in day but nowadays unless it's something very specific, jquery pretty much falls face first compared to native browser stuff. Using queryselectorall for example is alot faster in browser where as jquery is very slow, same goes for most common js functions and animations. So i am not for reinventing the wheel, i just don't like to use square tires when round ones are better and readily available.