News for hackers. Stuff that matters.
Re:The unreasonable effectiveness of declarative programming by jakelazaroff on Tuesday May 19, 2020 @11:58AM (#23236292)
> That code sample is such a list of actions, which for me makes it imperative code, meaning "first do this, then do that, then do the other thing."

Animation at its core is a sequence of images. Imperative animation code would describe how those images change every frame. (For example, a for loop in which you multiply properties by i in order to change them over time).

Declarative animation code would let you define keyframes — how the images look at specific points in time — and the library would generate the images in between them. (This is called "tweening" [0]).

The sample code in this case isn't a list of actions to be performed one after another. It's a list of states (keyframes), which the library interpolates between. That sounds declarative to me!

[0] https://en.wikipedia.org/wiki/Inbetweening

Re:The unreasonable effectiveness of declarative programming by adamdonahue on Friday May 22, 2020 @03:58PM (#23276243)
Spot on.