Skip to content

three state boolean logic

March 3, 2014

Three state boolean logic should be avoided. http://robots.thoughtbot.com/avoid-the-threestate-boolean-problem


2.1.0 :008 > true and false
=> false
2.1.0 :009 > true and nil
=> nil
2.1.0 :013 > false or false
=> false
2.1.0 :014 > false or nil
=> nil

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: