Ljubljana, Yugoslavia — In the rolling hills of Slovenia, with their prosperous, flower-decked houses and their trim ''kozolec'' haystacks, a farmer with 40 cows earns more than a university professor.
In the sun-warmed hills of Macedonia 400 miles to the south, thousands of hectares of land lie idle, their tillers fled to the bright lights of the republican capital of Skopje.
These two landscapes suggest both the potential and the problems of that stepchild of the Yugoslav economy: agriculture.
Before World War II, Yugoslavia was an important exporter of food. Now it can no longer feed itself. It's a net importer - to the tune of $111 million last year. Yet 1.5 million hectares (about 3.7 acres), a full fifth of arable land, are unused or underused.
Can this state of affairs - so embarrassing to a grain- and vegetable-rich country with yields per hectare approximating Italian and Austrian levels - be reversed?
The assistant federal secretary for foreign trade, Vinko Mir, thinks so. ''Yugoslavia importing wheat is nonsense!'' he exclaims. ''And we should have more sugar for export, and sunflower oil. Why not? It's no problem. We have the people to work. We have mechanization, fertilizer, seeds. We are even exporting seeds. Of course, coffee, bananas, cocoa, we will import. But quite a bit (of imported food) can be replaced by domestic production.''
Some optimistic Yugoslavs project $2 billion worth of food exports within an unspecified but ''short'' period.
It would take enormous work to reduce food imports, which were worth $960 million in 1980. It is not yet clear if Yugoslavia is fully committed to that effort. To be sure, the 1981-85 plan does give priority to agriculture, along with other enterprises producing substitutes for imports. And Belgrade is prepared to step up investment. But it may not be so ready to overcome its mistrust of private farming.
If anything will persuade the government, it will be the urgency of the situation. Unfavorable weather can be blamed for last year's 2 percent decline in output (with a public-sector increase of 1 percent and a private-sector drop of 3 percent). But the disappointing longer-term growth rate - averaging 1.6 percent a year during what was once announced as the 1976-80 ''Green Plan'' - points to structural weaknesses.
The first of these is investment. The Yugoslav peasants were not bled to industrialize the country the way Russian and Ukrainian peasants were in Stalin's collectivization. As in many developing nations, however, agriculture has been less glamorous than industry and in recent years has received only some 6 percent of total investment (7 percent, including water control).
The 1981-85 investment will go largely to flood and irrigation control in the northern plains, plus fertilizers. A plant at Kutina has started production for both domestic use and export. Some money will be funneled to farm machinery and food processing, with possible help from both the Soviet Union and various Arab countries which have expressed interest in long-term food contracts with Yugoslavia.
Such investments will have a limited effect unless something can be done to keep the peasant down on the farm. Yugoslavia's 75 percent rural population at war's end has now become 70 percent urban. Those who remain in the village are largely elderly and unable to tend those idle 1.5 million hectares.
The rural flight is less acute in the north; in Slovenia, Croatia, and Vojvodina there are some rich and even overmechanized farms. And in Slovenia, too, a dispersal of small industry that is unique in Yugoslavia has made it possible for villagers to live at home, work in a factory until 2 p.m., then tend their fields in the afternoon.
Paradoxically, the maldistribution of population is at its worst in the least developed southern regions, where farming carries more of a stigma of backwardness. In Macedonia a full quarter of the population huddles nonsensically in the republic's capital, Skopje, while Kosovo raises so few cows that it has had to import milk from Serbia.
In its own negative way, economic recession in Western Europe should help bring some of the currently idle lands back under the plow; many a Yugoslav emigre worker has fields and a house he can return to if his job in West Germany ends. The government also hopes that some of Yugoslavia's 814,000 registered unemployed will go back from the city to the village. This is a real possibility , given the ties that practically every Belgrade, Zagreb, and Titograd family still has with the ancestral village. There are hints that the government might even give a nudge by curtailing unemployment benefits.
More incentives to reverse the migration include last year's extension of retirement and health insurance benefits to private farmers in Slovenia and Croatia, and the steady rise in the standard of living in the countryside. Visitors to one Serbian village report that virtually all the houses now have indoor running water, and many new ones are outfitted with tubs and toilets in expectation of future sewage hookups. Village life thus seems more attractive when contrasted with the acute housing shortages in cities.
In private agriculture, the aim seems to be to link more farmers with local agribusiness ''combinats.'' In such arrangements the huge public-sector combinats - which possess only 18 to 20 percent of the land but produce more than 50 percent of market food needs - typically help the private farmer with tilling, harvesting, seeds, feed, and sometimes fertilizer. One million out of the country's 2.6 million private farm households participate.
A barrier to major expansion of private harvest sales to the state is the indifferent price structure. Yugoslavia, unlike Poland, does have a more or less modernized food price structure. The government subsidizes floor prices, with a budget that probably now equals between 1 and 2 percent of agricultural product. And with inflation of 1980-81, the government began subsidizing milk, bread, sugar, and edible oils for the consumer.
Between 1973 and 1979, however, agricultural producer prices rose 2.75 percent less than retail prices, and farmers' real income virtually stood still. Procurement prices were raised in 1980, but between now and 1985 they will again lag 2 percent behind retail prices.
This provides little incentive to private farmers to increase their harvests. Some farmers have even chosen to feed wheat and milk to their cattle rather than sell it.
Nor has the Yugoslav government had much interest in facilitating private investment, or expansion (or even consolidation) of the fragmented average of 3. 5-hectare private holdings. To date most investment in private agriculture has come from emigres or part-time factory workers who put their savings into the family farms. (Again, Slovenia, Croatia, and Vojvodina form a partial exception, with what the director of the Zagreb Economic Institute, Dragomir Vojnic, terms ''a lot of credit'' available at the bank for animal husbandry.) The net result has been a substantially lower ratio of machinery and fertilizer use (and productivity) in the private than in the public sector.
A year ago the head of the Vojvodina Province (the northern breadbasket plain) proposed expanding the current private holding limit of 10 hectares of private cropland. His bid was defeated. The view prevailed that with all the unused land (and Yugoslavia's extended family network), anybody who really wanted more land could get it anyway.