Skip to content

Conversation

@mkolodny
Copy link

@mkolodny mkolodny commented Dec 4, 2013

The example in the Conditionals section shows that if...else should be preferred over unless...else for negative conditions. Yet the description above the example says the opposite.
This removes the contradiction so that if...else is preferred in both the description and the example.

@mjrusso
Copy link
Member

mjrusso commented Dec 4, 2013

I think what the first sentence is referring to are statements like these, where the unless is used in postfix form:

# Yes
go() unless stop

# No
go() if not stop

So the sentence could read instead:

Favor unless over if not for negative conditions.

This does contradict the next sentence about unless...else, so it may be best to swap the order of the two sentences, include the example above, and reword the earlier sentence to something like this:

In postfix form, favor unless over if not for negative conditions.

This should preserve the original meaning and be less ambiguous.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sux

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants