0

Is there any difference in meaning between

check that newSnap != m_snap and invoke onSnapEnter only then.

and

check that newSnap != m_snap and invoke onSnapEnter only in that case.

?

Which is the correct way of expressing that the checked condition must fulfil, and not merely predate the invocation?

5
  • 1
    check that newSnap != m_snap and invoke onSnapEnter only in that case. is not idiomatic. ++ check that newSnap != m_snap and invoke onSnapEnter only then. has the wrong word order. It should be check that newSnap != m_snap and only then invoke onSnapEnter."
    – Greybeard
    Apr 15, 2020 at 15:36
  • 1
    The idiomatic way is probably "if newSnap is not equal to m_snap, call onSnapEnter" but that's probably a duplication of your code. If this is a code comment, it's not adding value. If there's a reason why you don't want to call onSnapEnter for a snap is not actually new, you should probably be explaining that here instead.
    – Hellion
    Apr 15, 2020 at 15:39
  • 1
    I think you are modifying a different sentence; check that newSnap != m_snap and invoke onSnapEnter then and only then. Corresponding to the logic of if and only if. This could well mean to go ahead and invoke onSnapEnter in any event so long as they checked the value of newsnap first. I think in common use this would not be the case but computer folks rely on precision. I would use Greybeard's word order to be sure.
    – Elliot
    Apr 16, 2020 at 3:44
  • @Greybeard Could you please post your comment as an answer, so I could accept it?
    – vines
    Apr 16, 2020 at 15:03
  • @vines Your wish is my command... :)
    – Greybeard
    Apr 16, 2020 at 22:02

1 Answer 1

1

check that newSnap != m_snap and invoke onSnapEnter only in that case. is not idiomatic.

check that newSnap != m_snap and invoke onSnapEnter only then. has the wrong word order.

It should be check that newSnap != m_snap and only then invoke onSnapEnter.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.