4 ms·
In non-declarative way it would look shorter and clearer anim_set("cx", 100); anim_set("cr", 0); anim_interpolate(ease_cubic, "cr", /val=/10, /time=/3));
by mD5pPxMcS6fVWKE 6y ago
In non-declarative way it would look shorter and clearer
anim_set("cx", 100);
anim_set("cr", 0);
anim_interpolate(ease_cubic, "cr", /val=/10, /time=/3));
etc
don't know what are you trying to achieve here
- chmod775 6y agoFirst off, this part: >anim_interpolate(ease_cubic, "cr", /val=/10, /time=/3) is still declarative. In any your example is incomplete and proves nothing because the end result should be a function that takes t and returns cy and cr. Not sure what your code is supposed to be really. Secondly, the author explained at length what the advantages of their approach are (purity, composition, time travel debugging, ...). I'm not sure what you're trying to achieve with your comment except trying to make yourself look smarter by deriding others.
- mD5pPxMcS6fVWKE 6y agoYou confuse declarative and functional. Declarative is when the sequence of execution is not related to the order of operators in the program text, but is derived at run time. The animation, where sequence of events is known exactly, is the poorest example for declarative programming.
- chmod775 6y ago> You confuse declarative and functional. No I'm not. Also functional programming is declarative programming (but not the other way around). If your code is supposed to be functional, it is also declarative. I was trying to freely guess what your incomplete example was supposed to do. Maybe I was wrong, but then you didn't provide much to work with. > The animation, where sequence of events is known exactly, is the poorest example for declarative programming. This wasn't a competition to come up with textbook examples of declarative programming.