Skip to content

Instantly share code, notes, and snippets.

@quamen
Created August 19, 2013 22:43
Show Gist options
  • Save quamen/6275089 to your computer and use it in GitHub Desktop.
Save quamen/6275089 to your computer and use it in GitHub Desktop.
API for feature flipping
I've been working on a feature flipping class, and I'm after some opinions on naming for the method that checks if the flip is active or not:
The example is for flipping the sign up feature of the application:
Which do you prefer and why?
do something if sign_up_is_active?
or
do something if sign_up_active?
@joho
Copy link

joho commented Aug 19, 2013

depends if your going to do elses.

if it's just a show/do x if why, I'd be inclined to put it in a block like

feature_flag(:sign_up) do
  do_something
end

@mynameisrufus
Copy link

What about:

do something if you_are_quite_certain_the_sigin_up_is_indeed_active

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment