Hacker News new | ask | show | jobs
by lasdfas 3782 days ago
I imagine this can only work on getters? How do you use this when code makes state changes?
2 comments

From Github's Scientist [1]:

Because `enabled?` and `run_if` determine when a candidate runs, it's impossible to guarantee that it will run every time. For this reason, Scientist is only safe for wrapping methods that aren't changing data.

When using Scientist, we've found it most useful to modify both the existing and new systems simultaneously anywhere writes happen, and verify the results at read time with `science`.

[1]: https://github.com/github/scientist/blob/master/README.md#de...

It only should be used for code which doesn't have side effects. According to original github lib.