Z
Z
zeuss562018-01-21 22:11:27
Programming
zeuss56, 2018-01-21 22:11:27

How do optimizers/minifiers work and what's the difference?

How from this one (abstract PL):

Hex C = "#000";  // "мысли" минификатора: значение не используется и обязательно изменится => пропускаем
int R = random(1, 3);  // R - число от 1 до 3
if (R == 1) C = "#111"
if (R == 2) C = "#222"
if (R == 3) C = "#333" // замечена какая-то закономерность => превращаем в массив
do this
Hex C = "#" + Array('111', '222', '333') [random(0, 2)]
?
Are there any code shorteners without loss of readability, such as turning noobish scripts into at least partially normal code? The question arose while rewriting my old code.
And how do such tools work from the inside?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question