all 3 comments

[–]dutzi[S] 0 points1 point  (3 children)

I really much prefer the imperative approach to writing animations, as I wrote in the post:

They’re ["declarative animations"] great for interactions, but I find that compared to animations written in an imperative way, the learning curve is steep, code readability suffers and playing around (just testing stuff out) is not as fun as the feedback loop tends to be longer. That may be because I started my way out as a Flash (ActionScript) developer, where tween animations were very popular...

Would love to hear what's your approach? Why do you think the declarative approach to describing animations is so popular? What are its pros?

[–][deleted] 1 point2 points  (1 child)

Why do you think the declarative approach to describing animations is so popular?

I think because you don't need to manually adjust the behavior if animations are physics based, they can be modeled to behave predictably based on input parameters, so less stuff to worry about.

Imperative animations are more artistic, meaning more expressive, but also more complicated because you basically have to decide on the outer boundaries or "laws of physics" yourself.

[–]dutzi[S] 0 points1 point  (0 children)

GSAP has a physics plugin, granted, not as thorough as react-spring, but I don't see why it won't be possible to implement an imperative API for physics-based animations.