Not really. If you publish X I can still patent X + Y and probably catch a lot of people doing a derivative of X. If you patent X then my X + Y patent is much less useful and if I become obnoxious about it you can always threaten to destroy my customer base by enforcing X.