Comment

Comment by ohanhi

Good feedback, thank you!

I will rethink some of the phrasing, especially on the reactive/imperative references. To be honest, the reactive part in the example is rather slim (arguably only the `Signal.foldp` is "reactive"), and it is so by design. I wanted to describe the appeal of writing pure functions first off, and then subtly bind the existing code to the signals at play. Obviously this is an opinionated decision.

Regarding the update function, I refrained from using the infix operator just to make the article a bit more approachable. Was I to write the code just for myself, it would have been:

    ship
      |> applyPhysics dt
      |> updateShooting isShooting
      |> updateVelocity newVel

This is also the reasoning for the argument order.
parent ohanhi 11 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton