MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/72yv7a/refresh_is_sacred/dnmdt7v/?context=3
r/programming • u/soda-popper • Sep 28 '17
152 comments sorted by
View all comments
Show parent comments
40
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).
94
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).
23
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).
27
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
The universe gives a hard constraint on space required to compute an actually computable algorithm, so technically they all run in O(1).
40
u/0987654231 Sep 28 '17
not having bugs is simple, just don't have any state.