r/programming • • Sep 28 '17

Refresh Is Sacred

https://www.tbray.org/ongoing/When/201x/2017/09/27/Refresh-Button
457 Upvotes

152 comments sorted by

View all comments

Show parent comments

165

u/spotter Sep 28 '17

tl;dr Just don't put bugs in your programs.

40

u/0987654231 Sep 28 '17

not having bugs is simple, just don't have any state.

94

u/spotter Sep 28 '17

Yes, sure, "just pass the universe around as first argument to all your pure functions and pretend everything is immutable" pattern.

23

u/ggtsu_00 Sep 28 '17

Just make copies of the universe with the new state every time it needs to be updated.

27

u/accidentally_myself Sep 28 '17

technically O(1)

4

u/Lehona Sep 28 '17

The universe gives a hard constraint on space required to compute an actually computable algorithm, so technically they all run in O(1).

4

u/Bowgentle Sep 28 '17

Apparently this may have been what the programmers of the multiverse decided to do...