This is my first attempt at posting, so forgive me if I submitted this in the wrong place; my post is an attempt to replace the deleted post "How to Prevent Being Farmed" which I found extremely beneficial but which has since been deleted by its author. Thanks in advance!
Here is a beginner's guide on how to keep from being farmed:
(1) Always send troops hunting--never leave them just hanging around in your fort. If a stronger player scouts you and sees troops just sitting there, (s)he will farm you on principle, just to get the easy prestige--and also because they see you as weak and foolish.
Garrisoning zero troops in one's fort may seem counter-intuitive at first, since you want to defend your turf, right? But the reality is that even if you have, say, 1000 infantry, 500 cavalry, and 750 catapults, a level-14 player with 5,000 catapults will simply send them over to annihilate you in one fell swoop; whereas if you have zero troops in the fort they will just pass you over and move on to someone who isn't as clever or informed as you are! (I had to learn this lesson the hard way, and I got bent out of shape about it the first time I got farmed--so much so that I now send a letter to everyone I farm, hipping them to the fact that they're being farmed for the very reasons we're talking about right now, and that it's easily preventable).
Also, don't be afraid to train, hunt, train some more, harvest, and re-hunt (having added the new troops) many times in a row for little or no money. Hunting is not about the money (at first); it is first-and-foremost about keeping those newly-minted troops out of the scout-reports of strong players looking for a juicy target to farm. (Later, when you've built up armies in the multiple-thousands, the money will come flowing in from hunts.)
Following this same logic, make sure that you are always there for your troops when they come out of training, so you can send them hunting right away. The easiest way to do this is to set your iPhone timer. If your barracks has troops coming out of training in 1.5 hours, set your timer for 1:29:00 and then jump back into the game when it goes off and send your new troops hunting real quick, before returning to your real-world concerns.
By the same token, never make training troops the last thing you do before going to bed. They will just end up sitting out in the open for hours, glowing like a neon beacon and screaming "Farm me! Farm me!" to all the stronger players who happen to glance at your fort while you're away.
(2) Use the Market like a second, unlimited Cranny. No one will try to farm you if you have no resources sitting there to be farmed, right? If you're about to be away from the game for a while (sleep, school, work, etc.), list all your excess resources for sale at the Market. Just set the price at the highest level possible on the slider. (Trust me, no one will buy it--but if they do, you will then have that cash!) Later, when you return to the game, simply cancel the sale and--voilá--your resources are back, fully intact, and ready to be utilized.
Keep in mind, though, that your number of citizens will decrease proportionally to the amount of each resource you list at market (someone's gotta do the carrying). But they'll build back up by the time you're back from being gone. If you find your number of people goes to zero every time you list your excess resources, upgrade your Main Building until you have enough transporters to comfortably carry all your resources each time.
(3) Make sure you upgrade your Cranny's capacity to match or exceed your Warehouse's. Don't worry about this step until you've started occupying oases, since your resources are in such short supply right now anyway. But once you do, you will be surprised how easy it is to upgrade your Cranny with relatively little expense compared to other buildings.
And the payoff is enormous: once farmers see that your Cranny matches your Warehouse capacity, you won't see them again; nothing makes a farmer quit farming you faster than them attacking someone with all 85,500 resource levels and then looking at a bunch of zeros at the bottom of his or her War Report!
Keep in mind that this technique only works up until 100k of each resource; beyond level 20 there is no Cranny protection. But don't worry--by that time you will have developed techniques and strategies to render that fact irrelevant; you will be strong enough to handle it.
(4) Build traps instead of turrets. Turrets can be obliterated from a distance by catapults as they sit out of range; but the only way to cure traps is by marching through them. Which means your farmer's going to lose at least some guys. Plus they're way cheaper to build than turrets. The exception to this rule, later, is when you're able to upgrade your turrets to level 8--level 8 turrets eat catapults for breakfast.
Keep in mind, however, that you can easily get by, at first, without turrets OR traps. Steps 1-3 above will suffice to prevent you being farmed. Use those resources, instead, to build troops to occupy oases!
One final thing I'll say about farming is this: be nice about it once you, yourself, start farming. Try to farm only truly inactive forts, at least at first. There are tons of inactives out there; give the new people a chance to discover all the possibilities of this wonderfully addictive game before crushing their spirit and driving them away. It will be more fun for everyone in the long run!
Good luck, and happy hunting!