Is "code that generates code" really all that great?

Posted by Jaxo on Programmers See other posts from Programmers or by Jaxo
Published on 2013-10-26T03:25:56Z Indexed on 2013/10/26 4:09 UTC
Read the original article Hit count: 332

Filed under:
|

I was looking through CodePen's "popular pens" and I noticed this cool little spiral animation somebody made with a seemingly ridiculously small amount of code.

This is quite impressive until you click the headings for HTML and CSS to show the "compiled" versions of the same code. Suddenly the 3 lines of HAML and ~40 lines of SCSS turns into a gigantic monster of repetition. Here's where my question comes in:

Is it acceptable to do something like this in practice? Don't get me wrong - I love using preprocessors to help me write code faster, but in some cases it looks like it's an automatic copy-paste machine.

© Programmers or respective owner

Related posts about methodology

Related posts about logic