Uri:
How do you stop farming? That's a complex answer. There are a number of techniques.
You can get your clan to pin your farmer, you can just ignore the farmer until he goes away, or you can relentlessly bring the battle on your own to the person attacking you. (that's the most fun)
No matter what, the key to stopping a farmer is knowing that the hits really don't matter at all, and farmers cannot hurt you. You can bank your $$$ and your troops regenerate every hour. If a farmer figures out that his hits do not annoy you, he/ she will be effectively neutered. Why swing away at a target that doesn't care? Farmers enjoy nerd rage.
(end diatribe on dealing with farmers)