Yes! This is excellent, especially when not wanting to deviate onto something sugary at home. If the temptation is not within reach, the effort to go and purchase a treat often allows you to have time to stop and think about the decision.
It can be a little tougher at work though, especially when co-workers bring doughnuts, biscuits and more into your space. This is where leaving the workspace without taking cards or cash with you, or opting for something like fruit which contains natural sugars, can help you avoid those temptations that have been brought into your space.