IN the five years since the last farm bill was passed, the number of farmers' markets in this country has grown to nearly 4,500 from 2,750, gladdening the hearts of foodies who like nothing better than seeing locally grown Chioggia beets, butter radishes, Early Girl tomatoes, miniature pattypan squash, chervil, fresh goat cheese logs and duck breast in a conveniently located market.

Some of the best customers of farmers' markets, though, haven't been free-spending foodies, but food-aid recipients. Happily, the new farm bill before Congress has several proposals to vastly increase food aid to the poor, including two programs that allow them to buy at farmers' markets.

That normally would be great for small farmers. Without the guaranteed income from the farm bill's $15 million Seniors Farmers' Market Nutrition Program and the separate $25 million Farmers' Market Nutrition Program (part of the food aid program for families known as WIC), some small growers would be out of business, and many others would be reluctant to sell in low-income neighborhoods where fresh produce is otherwise a rarity -- ''food deserts.''

But, it turns out, new efforts to encourage food-aid recipients to eat more fruits and vegetables -- which are calamitously underrepresented in American diets -- could end up shutting out the small farmers who are the backbone of these markets.

The Agriculture Department has proposed rules that would reallocate WIC benefits now restricted to eggs and dairy products, which have long enjoyed the muscle of well-financed lobbies, to fruits and vegetables, which haven't. Millions of children would be entitled to $6 a month for produce. And in its initial proposals for the new farm bill, the Bush administration suggested making available $200 million, starting next year, to buy fruits and vegetables for the poor. If such suggestions get approved, hundreds of millions more dollars could be spent every year on fresh produce.

There's a big catch, though: small farmers might not reap the windfall. Over the past 15 years, most states have switched from paper coupons for food stamps to debit cards, removing the stigma of redemption at the checkout counter. The WIC program, which still uses paper, will most likely do the same. Most farmers, of course, don't take plastic -- and, market managers say, they have seen their sales plummet with the switch from paper.

The need for farmers to enter the cashless economy is obvious. Wireless card readers will benefit both people on food assistance and foodies who (like me) don't carry all the cash they end up eager to spend. But who will pay for the machines, which can cost as much as $1,500 and incur steep monthly service fees, not to mention workers trained to use them?

Without card readers, farmers fear they will lose the bulk of the farm bill help they get now, and be shut out of those new hundreds of millions. The proposals at the Agriculture Department and in the farm bill would let food-aid recipients buy fruits and vegetables wherever they can find them. That means supermarkets -- which remain the most convenient place to buy produce. Farmers' market advocates are alarmed. The money will go to the centralized industrial farms that supply supermarkets, they say -- the ones that crush small farmers and waste fuel.

So: Help small farmers and the places dedicated to selling truly local food, or help the sharply increasing number of people struggling to feed themselves and their families? The most equitable way to help farmer's markets may be to urge legislators to support good programs already in the farm bill, like the Farmers' Market Promotion Program and Community Food Projects. These could equip farmers with card readers, an essential first step, and finance other ingenious projects to help small farmers thrive.

Concerned cooks (and everyone else) should urge increases for education programs that tell people how and where to use food stamps. Only 56 percent of people eligible for food stamps get them, and most of those recipients don't know that the stamps can be used at farmers' markets. A reason often given for the great success of the WIC farmers' market program is the nutrition education that comes with it.

Yes, supermarkets may well get the great majority of increased benefits for fresh produce. But a small slice of a much larger pie could amount to as much as or more money than farmers' markets now get from food-assistance programs.

And the new money available for fruit and vegetables would mean that ''specialty crops'' -- the kind we actually think of as food, as opposed to crops like corn, soy and cotton that get the much criticized multibillion-dollar commodity subsidies -- would finally get support from the farm bill. More people would eat healthier diets, and farmers might start growing even better-tasting varieties, confident of finding a market.

Many other programs proposed for the farm bill could bring locally grown food to places that want and need it, like schools and hospitals. But farmers' markets are where the bill can best serve cooks -- a frequently well-financed, always opinionated special-interest group that should start acting like one.

Drawing (Drawing by Tim Lane)