Align DSL for experiments and deprecate .use and .try
One issue I had when reading through scientist readme: it is for running all blocks that are given. And when you look at the API with .use
and .try
blocks it makes sense.
That's where I struggled to draw the line from an API design to experiments, where we only want to run one of these blocks. But even when not knowing about scientist, we use different nomenclatures. We usually talk about a control
behaviour/group or a candidate
behaviour.
My suggestion is to deprecate .use
and .try
. The API for running an experiment would look like the following then:
def show
experiment(:notification_toggle, actor: user) do |e|
e.control { render_toggle }
e.candidate { render_button }
end
end
In our README, we even comment it as # control
and # candidate
, which I think is a good indicator to align naming here
What do you think? Happy to take over the MR in one of our pairing sessions. I think it would favour everyone to let me implement this feature because I would have more questions than answers :)
cc @jejacks0n