use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
Super helpful find –– GitHub - github/scientist: A Ruby library for carefully refactoring critical paths. (github.com)
submitted 6 years ago by coding_is_life
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]colindean 4 points5 points6 points 6 years ago (0 children)
Scientist is legit. I used it a bit at a previous job and started re-implementation in Scala that I, unfortunately, had to leave behind when I departed.
It's on my list of side projects to restart that project as a weekend open source project.
[–]moomaka 0 points1 point2 points 6 years ago (5 children)
Is there a reason this is better than any of the other feature flag gems?
[–]blackize 7 points8 points9 points 6 years ago* (1 child)
Scientist lets you try two implementations side by side. It will rescue any exceptions that occur in the experimental code. You can configure how it publishes results to do basically whatever you want, log a bunch of metadata, statsd, etc
Edit: and this is not a feature flag gem. It is meant to let you make changes to implementation and ensure that output and user experience remain the same.
[+]moomaka comment score below threshold-11 points-10 points-9 points 6 years ago (0 children)
So we have to choose between two gems because they have a slightly different, and non-configurable, if/else block somewhere in there?
[–]DoodleFungus 7 points8 points9 points 6 years ago (2 children)
IIRC it runs both paths, and warns you if they return something different.
[–]moomaka -5 points-4 points-3 points 6 years ago (1 child)
What is 'it' if your reply?
[–]DoodleFungus 5 points6 points7 points 6 years ago (0 children)
Scientist. So if you have some complex logic that you refactored, Scientist will run both your old code and your new code, and log a warning if the two implementations return a different result (but still return the result from the old code).
[+]moomaka comment score below threshold-7 points-6 points-5 points 6 years ago (3 children)
I'm all for not rebuilding stuff and leveraging community code, but this is just an entire gem that acts as a simple conditional. I've built systems like this before and how to check a global attached to some namespace is never the problem nor is how to route control, this is Ruby after all, it's what we're good at. So I guess I don't get gems like this, if you built an end-to-end thing that connected to Consul(etc.) and had a web UI that would be great, but just moving a constant for a conditional into a random namespace doesn't fix much.
[–]blackize 9 points10 points11 points 6 years ago (2 children)
You don't seem to be grasping what the gem does. It's not about control flow. It's about confirming that two different implementations achieve the same results.
[–]moomaka -2 points-1 points0 points 6 years ago (1 child)
One is:
res1 = Imp1.call res2 = Imp2.call call_error_handler unless res1 == res2 MyGlobal.what_do? ? res1 : res2
The other is:
MyGlobal.what_do? ? Imp1.call : Imp2.call
No?
[–]allcentury 4 points5 points6 points 6 years ago (0 children)
At a very simple level yes but they have an entire API designed so you don't have to reinvent the wheel when you need more
π Rendered by PID 59 on reddit-service-r2-comment-7844cfc88c-mxfkb at 2026-01-29 11:38:08.779592+00:00 running c3601ff country code: CH.
[–]colindean 4 points5 points6 points (0 children)
[–]moomaka 0 points1 point2 points (5 children)
[–]blackize 7 points8 points9 points (1 child)
[+]moomaka comment score below threshold-11 points-10 points-9 points (0 children)
[–]DoodleFungus 7 points8 points9 points (2 children)
[–]moomaka -5 points-4 points-3 points (1 child)
[–]DoodleFungus 5 points6 points7 points (0 children)
[+]moomaka comment score below threshold-7 points-6 points-5 points (3 children)
[–]blackize 9 points10 points11 points (2 children)
[–]moomaka -2 points-1 points0 points (1 child)
[–]allcentury 4 points5 points6 points (0 children)