Farming is a technique to maximize your harvest while at the same time minimizing your consumption of resources. This is done by leaving wheat unharvested in places where it can still grow into the surrounding squares, rather than wasting its growth while surrounded by other wheat.
The best farming technique discovered so far involves rows of forbidden resources separated by two rows of growth space:
The rows can be any length, but it should generally be around 3-6, because less than 3 is too short to be very effective and more than 6 is likely to trap globs when the field grows. They can be horizontal or vertical, although they should generally be perpendicular to water. This technique has no value away from water, because at 16 squares away from the nearest water, wheat ceases to grow altogether. After the wheat is harvested from the open area, the farm should look something like this:
This farm now has 36 spaces the wheat can grow into, whereas before it had just 9. In practice, randomly harvested fields will perform slightly better than rectangular ones, but proper farming will still produce more than twice the crop. Farms are also more sustainable: If there is more demand than supply, your globs will simply starve, instead of taking what is left and leaving nothing for later.
This layout gives you significant protection along your coastline, with little or no loss of production capacity:
Enemy warriors will have to walk around the wheat barrier to find a way into your town. This allows you to create specific points of entry which can be defended much better than a long porous border. Beware though that smart enemies can send a wave of workers to break a hole in the barrier, and attack you at a poorly defended spot.
Extending a farm
Creating a new row of wheat is a slow but simple process. First, you forbid an area to the side of your farm...
... wait for wheat grow to into the new area ...
... and you have yourself a new row of crops.
This technique is for people who want to do farming/farm-extension quickly while risking to get a sub-optimal result like slightly slower harvesting and sea-side attacks. Look how easy it's done: