3 ms·
What I do: Write pure functions, but don't shy away from mutating lexically scoped state in order to improve performance. For global stuff, wrap it with classes
by TurboHaskal 7y ago
What I do: Write pure functions, but don't shy away from mutating lexically scoped state in order to improve performance. For global stuff, wrap it with classes since objects are a commonly understood way to reason about state.
- Ambrevar 7y agoFor immutable data structures, there is this helper library which can help: http://quickdocs.org/immutable-struct/ http://quickdocs.org/immutable-struct/