Live data from Hacker News

Less.js will obsolete CSS

fadeyev.net

1–10 of 131 posts

Re: Less.js will obsolete CSS

#3
Admitedly, I'm a relative n00b when it comes to development but seriously "I do not get it". There doesn't appear to be much in the way of reduced syntax, at least not in the example provided. Can someone explain why this is better or clearer than CSS?

Re: Less.js will obsolete CSS

#5
post #3

Admitedly, I'm a relative n00b when it comes to development but seriously "I do not get it". There doesn't appear to be much in the way of reduced syntax, at least not in the example provided. Can someone explain why this is better or clearer than CSS?

There is genuinely a tiny benefit because you don't need to declare colors etc more than once, everything else about it is trying to wedge ideas from other areas of programming into a language that contains so many abstract concepts as to not benefit from it at all.

I've worked as a UI developer for 12 years now and I wouldn't go near something like this because there is no value. At least the server side version you can pre-process and package up for live after your developers have saved literally minutes by using it. You need to know CSS inside out, so you have to then unlearn and relearn different parts just to do something you can already do with find + replace.

And worse, you are even including and downloading files that the browser cannot even interpret itself without relying on another download of JavaScript as well, so you're giving something that works 100% of the time (assuming someone has CSS on) another point of failure. Most of my time in UI has been in public sector education trying to push standards and quality from various suppliers to the Govt and seeing things like this from said suppliers (I've seen worse to be fair, but I've seen something like this before) is always an unpleasant experience.

Re: Less.js will obsolete CSS

#6
I cranked out something similar to this years ago called in Lua and C called moonfall, actually more powerful because it was extendable, even got on smashing magazines "best of the month" or something like that, and I'm pretty sure it didn't obsolete CSS. Actually I don't think anybody used it, not even me. Maybe because Lua didn't have the buzz that javascript has now. http://moonfall.org/

Re: Less.js will obsolete CSS

#7
post #3

Admitedly, I'm a relative n00b when it comes to development but seriously "I do not get it". There doesn't appear to be much in the way of reduced syntax, at least not in the example provided. Can someone explain why this is better or clearer than CSS?

There aren't many features, but they fill in various "holes" in CSS (compared to every other programming language).

For one example, you can define "constants". That means you can define a color once with a name (say, LINK_COLOR = #aaa), then use that name over and over. Then, if you ever feel like changing that color, you only have to change it once (where it says LINK_COLOR = ), not every time.

Other benefits are something akin to "functions", and ways of "nesting" your CSS which automatically makes certain classes only apply to nested elements (this is something most people do anyway, they just do it by hand).

Re: Less.js will obsolete CSS

#8
post #3

Admitedly, I'm a relative n00b when it comes to development but seriously "I do not get it". There doesn't appear to be much in the way of reduced syntax, at least not in the example provided. Can someone explain why this is better or clearer than CSS?

It might not seem all that great from the simple example provided, but Compass (http://compass-style.org/, uses SASS) is a great example of how mixins can make your life so much easier.

For example, if you want to make an inline list it's as easy as:

li +inline-list

Re: Less.js will obsolete CSS

#9
post #4

Literally the only problem with CSS itself is that it doesn't have defines. Every other problem is just browser implementations.

I also have issues with the "box model." Judging by the popularity of grid layout systems like blueprint and 960 I think others also do.

The box model is fine when you just need to "flow" things around things, like text around images, and typical blog designs, but when you develop complicated interfaces it really shows its limitations and costs many hours of frustrating effort.

Re: Less.js will obsolete CSS

#10
Does the preprocessor generate raw (i.e. conventional) CSS, which it then convinces the browser to evaluate or re-evaluate as necessary, or does it actually apply the styles itself with JS? i.e. something equivalent to jQuery('.heading').css("color", "red").
Post reply on HN