LESS? - the opinion of the layman-typesetter or designer with experience

Welcome all! My name is Sergey, I live in Samara, I'm 37 and I am bearded, but only when the power of creation defeats all other physiological processes in me ... Today I will share with you my experience of the practical use of LESS. What can I say, LESS is fashionable and, as you know, in the IT environment is used by everyone who is not lazy ... sometimes even contrary to common sense.

What is LESS? Less is the language! But is it a language? In the words of the layman-typesetter: we write some code, compile it, and at the output we get all the same CSS .
... and here for some reason I immediately remembered the expression of a colleague programmer Fedi, with whom we jokingly experience each other's worldviews. So, he said: “Down with the little things! Forward the functional! ”It is clear that for the designer these words are simply“ with a knife to the heart ”.

But we were a little distracted and, in general, this is not the point .

So, Less.

Less expands the power of CSS by allowing you to set variables, mixes, etc.
- So?
Well, that is, everyone now agreed with me?
... so I hear the millionth choir.
But in fact, the solution also has disadvantages.


Many proponents of the language speak, for example, of such use.



Set the color variable:

@base_color: #ccc;

Then we use it in the elements:

p {
 color: @base_color;
span {
 background-color: @base_color;

From the point of view of the supporters of the language, this is convenient: to change the color of all elements - changed the color in one place - and that’s all.

From my point of view it is very controversial:
  • Firstly, as I said earlier, it is commonplace - to change the color of an existing element, you need to find the element that needs to be corrected, then find the variable to which the color itself is already assigned. And there can be a dozen such variables, and they can all be in different, separately connected files, the number of which, as you know, can also be in the tens.
  • Secondly, the argument of supporters about what's convenient: “Changed in one place - fixed all the buttons!” Is for people who don’t know or forgot what batch replay is! It’s simpler, faster and more reliable to immediately find the #ccc color and make “Replace All”.
  • There is also an imaginary “convenience” less in that it is easy to change the color by adding or subtracting directly in the code, but this is again in quotation marks - since if a person has a graphic editor at hand + if he has been engaged in typesetting for a long time and knows by heart the basic color codes - he does not need to add or subtract anything - he immediately prescribes the code.

It would seem pluses?

This is where there really are pluses (as I initially thought), so in mixing, when a huge number of parameters are set in one variable (for example, vendor properties a la
...), and then this variable is turned on-mixed into the elements used - the code is greatly reduced.

But I’ll ask you a question: why shorten the code when it compiles anyway and expands and expands to the parsed CSS state? In fact, we get a certain layer (sometimes consisting of many files) it is not clear why, which slows down the search for a parameter, but does not affect the final form of the code.

Less really can be less effective if a year or two is to conduct general code refactoring, then yes - it probably makes sense ... But even then, at first glance, the real pluses are, in fact, just fiction and a waste of valuable time ... Ask why?
Answer:because it’s not a full-fledged language and at the end we get all the same bulky CSS constructs. That is, no matter how we try to reduce or optimize - we optimize only the layer.

Maybe Less in general - a marketing move, a fashion trend, some kind of secret conspiracy to promote the language - I often hear from programmers ( some programmers ) that using less is a banal sharpening of a project for programmer abstract thinking. Although how the programmer abstract thinking differs from abstract thinking in general, or the better it is from the abstract thinking of a typesetter / designer, is a great mystery covered in darkness .

As I now mean for myself LESS
- A tool designed to facilitate the work of a programmer if he does not know how to typeset. For the layout designer, this is equivalent: how to put on galoshes instead of sneakers for a runner, nothing that constantly flies, but not wet.

All of the above is just my opinion, it does not have the intent to somehow interfere in the development process of fans of their craft.
I just wanted to share my designer everyday life, I hope I did not tire.

Also popular now: