Hacker News new | ask | show | jobs
by OptionOfT 246 days ago
Isn't

> Now, imagine your request is actuator.rotate(90).

a good example of something that is not idempotent? As it is based on its current position. Actually idempotent would be: `actuator.rotateTo(Degrees(90))` with a predefined frame of reference, or a frame of reference that you can include in the request.

Like the difference between a servomotor vs stepper motor.

1 comments

Your suggestion of actuator.rotateTo(Degrees(90)) is precisely the right way to engineer a robust, idempotent command for the physical world.

I used the simpler, non-idempotent rotate(90) example intentionally to illustrate the default trap. How a pure software mindset can dangerously oversimplify a physical action.